Hi,
I want to format a number which built-in format code such as: C, N, G.... but how can I display their actual code for user to see it? Because C, N, G is too ambigous, displaying as sequence of #, 0 is more comprehensive.
Please help.
Hi,
I want to format a number which built-in format code such as: C, N, G.... but how can I display their actual code for user to see it? Because C, N, G is too ambigous, displaying as sequence of #, 0 is more comprehensive.
Please help.
N, C, G, F, etc, are the Standard Numeric Format Strings, any other numeric format string interpreted as a custom numeric format string.
The standard format strings won't give you the same formatted result always, they are Culture dependent, and they will be interpreted differently depending on the current thread or specified culture.
For example:
CultureInfo enUS = new CultureInfo("en-us");
CultureInfo deDE = new CultureInfo("de-DE");
double number = 120.50;
number.ToString("C", enUS); // outputs $120.50
number.ToString("C", deDE); // outputs 120,50 €