以前比较孤陋寡闻,今天才知道德语中小数点是显示为","的,例如1.5在德文中应该显示为1,5。如果要在德文下面正确显示要象下面这样写才对。

 

NumberFormatInfo numberInfo = CultureInfo.CurrentCulture.NumberFormat;
double myAmount = 1.5;
MessageBox.Show(myAmount.ToString(
"G", numberInfo));


进一步来说,小数点 显示为"."还是",",是可以设定的:

控制面板 - Region and Language - Fomats - Additional settings... - Decimal symbol

 

我们可以用方法

System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator
来得到目前系统小数点显示方式的设定。

相关文章:

  • 2021-08-12
  • 2021-07-22
  • 2021-06-11
  • 2021-08-05
  • 2021-05-25
  • 2021-06-22
  • 2021-07-26
猜你喜欢
  • 2022-02-19
  • 2021-11-07
  • 2021-09-09
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
相关资源
相似解决方案