C# 浮点数国际化

2019-01-04  本文已影响0人  QuinShuai

The NumberDecimalSeparator for the culture ru-RU is "," whereas in en-US, it's ".". Some cultures use a comma, some use a period. If you need something, well, Invariant, try InvariantCulture:

float.TryParse("0.58", NumberStyles.Any, CultureInfo.InvariantCulture, out f);

上一篇下一篇

猜你喜欢

热点阅读