tags:

views:

32

answers:

1

Hi,

In ASP.net using VB, how can I Convert a number e.g 4.5 to french (4,5).

And a quick question, when storing this in database, will It store as 4.5 or 45?

Thanks,

Kyle

+2  A: 

A number is just a number, it doesn't contain any formatting or culture information. You can specify how to convert it to a string using a specific CultureInfo or FormatInfo object:

string formatted = number.ToString(CultureInfo.GetCultureInfo("fr"));

If you store the number in the database as a number, it's neither stored as "4.5", "4,5" or "45", it's stored as the binary representation for the number. If you store it as a string, how it's stored depends on how you convert the number to a string before storing it.

Guffa