更改小数点后出现的值的数量-Visual Basic 2010 [英] Altering the number of values present after a decimal point - Visual Basic 2010

查看:69
本文介绍了更改小数点后出现的值的数量-Visual Basic 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含数值的文本框,但是由于将这个数据添加到列表框中时使用的公式,因此小数点后存在很多值.我想知道如何更改它以将列表框限制为仅在小数点后显示3个值?

I have a textbox containing numerical value, but due to the formula I am using for my project when this data is added into a listbox there are alot of values present after the decimal point. I was wondering how I could alter this to restrict the listbox to only displaying 3 values after the decimal point?

推荐答案

您将首先阅读

尝试像这样

try Like This

Dim mydecimal As Decimal = Format(yourvalueFrmDatabase, "0.000")

textbox1.text = mydecimal 


这篇关于更改小数点后出现的值的数量-Visual Basic 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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