Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

regional option number

Status
Not open for further replies.

jigolo

Programmer
Jan 6, 2004
20
CA
how can I get the decimal symbol for the computer, ex: "." or "," when I use double to string.
 
Check the NumberFormatInfo class.

To create a NumberFormatInfo object for a specific culture:
Code:
CultureInfo frenchCultureInfo = New CultureInfo("fr-FR");
NumberFormatInfo frenchNumbering = frenchCultureInfo.NumberFormat;

// French (france) decimal seperator is:
string frenchDecimal = frenchNumbering.NumberDecimalSeparator;

To use it for the current thread's culture:
Code:
NumberFormatInfo currentNumbering = CurrentInfo.NumberFormatInfo;

// thread's decimal seperator is:
string threadDecimal = currentNumbering.NumberDecimalSeparator;

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top