Specify a culture in string conversion explicitly

时间:2023-03-08 23:52:42
Specify a culture in string conversion explicitly

Specify a culture in string conversion explicitly

There are different methods of grouping symbols, like 1000; 1 000 and 1'000. Besides there are different digits used for numbers in different countries Chinese numerals

You can see different numbers in Control Panel -> region and language -> Formats -> additional settings -> Standart digits. (Win 7)

比如负数的格式

Specify a culture in string conversion explicitly

另外一个例子,英文和法语中小数点和千分位的符号不一样

Because, for example, English cultures use '.' as a decimal point, where as French cultures use ',' and the opposite to separate thousands.

Specifying a culture removes this ambiguity so that code executes identically on Windows operating systems configured for different languages, particularly if the parsed values are being committed to persistent storage.