Windows 7上的C#十进制数字 [英] C# decimal numbers on windows 7

查看:67
本文介绍了Windows 7上的C#十进制数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用c#完成了mini app,并具有数据库访问权限2007
我已经使用x86平台在xp中调试了它
工作完美都很好,但是当我在win7上运行时我遇到了问题,我在数据库中将exp 2.2的十进制数字放在了这将保存为22
有些人可以帮助我为什么他保存它22而不是2.2
对不起,我的床English

i have done mini app in c# and with database access 2007
and i have debug it in xp with platform x86
work perfect all good but i have problem when i run it on win7 and i put number with decimal for exp 2.2 on database that will be saved as 22
some can some one help me why he save it 22 and not 2.2
sorry for my bed english

推荐答案

首先要检查的是文化背景:如果他和你的不一样,那么根据你的做事方式,你会可能会得到不同的结果.例如,如果他的文化设置为使用逗号作为小数点分隔符,则可以假设该点是放错位置的千位分隔符并忽略它.

除此之外,我们需要查看用于加载文本框,读取文本框,将其转换为数字并将其保存到数据库中的代码.
The first thing to check is the culture setting: if his is not the same as yours, then depending on how you do things, you may get different results. If for example his culture is set to use comma as a decimal separator, then it could be assuming the dot is a misplaced thousands separator and ignore it.

Other than that, we need to see the code you use to load the text box, read the textbox, convert it to a number, and save it into the DB.


OriginalGriff
我要尝试很多:)
OriginalGriff
thnx alot i will try it :)


这篇关于Windows 7上的C#十进制数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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