数字输出表示法的问题 [英] problem with output notation of numbers

查看:71
本文介绍了数字输出表示法的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对数字的输出表示法有一个不寻常的问题.数据源是共享点中的列表,其中存储的数字格式为:0,002和66,00(塞尔维亚表示法,在美国等于0.002和66.00)
在我的C#应用​​程序中,这些数字分别表示为0.02和66,我对此无能为力(不能再从应用程序中编辑数字).
有人有什么主意吗?

在此先感谢,

I have an unusual problem with output notation of numbers. Source of data is list in sharepoint, where numbers are stored is in this format: 0,002 and 66,00 (serbian notation, in US is equivalent with 0.002 and 66.00)
In my C# application these numbers are represented as 0.02 and 66, and i can''t do nothing about it (numbers can''t be edited from application anymore).
Does anyone have any idea?

Thanks in advance,

推荐答案

那不是很正确.
That''s not quite true.
The C# specification[^] gives all number entry in western format: nnn.dddd, and does not allow for other culture numeric formats. So it is legal to write
double d = 6.55;

但写法从不合法

But never legal to write

double d = 6,55;

程序运行时的数字输出,但是通常是当前的区域性格式:因此,如果您的PC设置为塞尔维亚语,则应该获取塞尔维亚语格式的数字.

您只是无法使用它们编写代码!

Number output when your program is running however is normally in the current culture format: so if your PC is set to Serbian, you should get Serbian format numbers.

You just can''t write your code using them!


这篇关于数字输出表示法的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆