最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
[VB.NET] Single & Double
时间:2022-07-02 11:16:46 编辑:袖梨 来源:一聚教程网
---VB.NET Single & Double---
single的精度的问题
先简单说明一下:项目里面有个金额的内容,一开始使用的single,后来发现只有金额在(-100000.66,1000000.66)区间中才能真实的储存对应的值,测试了一下代码如下:
小数点后第二位6开始进位,例如100000.66成为100000.7
1Private Sub Button1_Click()Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
2 Dim a As Single
3 a = TextBox1.Text
4 Label1.Text = a
5 End Sub
改成Double:
测试成功
1 Private Sub Button1_Click()Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
2 Dim a As Double
3 a = TextBox1.Text
4 Label1.Text = a
5 End Sub
所以金额的类型要设为Double,咳咳.
---end---
相关文章
- 功夫熊猫:神龙大侠官网首页入口 功夫熊猫:神龙大侠官方网站 04-08
- 问剑长生官方网址 问剑长生首页入口 04-08
- 对决!剑之川官网首页入口 对决!剑之川官方网站 04-08
- 剑中官方网页入口 剑中首页入口 04-08
- 暗区突围:无限官方网站入口 暗区突围:无限官方网页版 04-08
- claudeCode官网入口 claudeCode官网中文版地址 04-08