Flexgrid - 格式浮动问题 [英] Flexgrid - format float problem

查看:55
本文介绍了Flexgrid - 格式浮动问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用flexgrid



要将我的浮点输出格式化为网格我正在使用



I am using a flexgrid

To format the output of my float to the grid I am using

output.Format("%2.0f",value)





这将我的浮点数(值)四舍五入到这个命令之后的整数,说值是8.5输出是9然后发送到flexgrid





有什么想法吗?



and this is rounding up my float(value) to an integer after this command, say value was 8.5 output is 9 which is then sent out to the flexgrid


any ideas please ?

推荐答案

您的格式字符串指定小数点后面没有数字,因此它会自然地舍入该值。试试......

Your format string specifies no digits after the decimal point so it will naturally round the value. Try ...
output.Format("%5.2f",value)



......它总是很好想要阅读文档。


... and it''s always a good idea to read the documentation.


这篇关于Flexgrid - 格式浮动问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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