Robert
Robert

Reputation: 51

Converting Number to French

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

Upvotes: 0

Views: 333

Answers (1)

Guffa
Guffa

Reputation: 700730

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.

Upvotes: 3

Related Questions