Jan 21, 2004 #1 jigolo Programmer Joined Jan 6, 2004 Messages 20 Location CA how can I get the decimal symbol for the computer, ex: "." or "," when I use double to string.
how can I get the decimal symbol for the computer, ex: "." or "," when I use double to string.
Jan 21, 2004 #2 chiph Programmer Joined Jun 9, 1999 Messages 9,878 Location US 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 Upvote 0 Downvote
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