开发者

Problem in displaying float value in label from Database:

I have stored 1000.5 value (datatype float) in database.. but when i am retrieving that value and displaying in label. so it displays like 1000.04998779297..

what shou开发者_Go百科ld i do?

thnx


You need to format the value ...

String.Format("{0:0.0}", 123.43543545);

Result:

123.4


Check String Format for Double [C#]


You can also do using

Convert.ToDouble(dt.rows[0][0]).ToString("0.00");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜