最新下载
热门教程
- 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---
相关文章
- 歪歪漫画-韩漫全网最全入口 03-09
- 漫蛙2官网-台版正版入口 03-09
- 羞羞漫画sss-登录入口2026 03-09
- 拷贝漫画最新版怎么下载?2026最新可用官方网页版与移动端分享 03-09
- 拷贝漫画官网下载安卓版最新2024-拷贝漫画官网下载入口电脑版 03-09
- jm漫画网页版免费登录教程-jm网页版漫画免费畅读 03-09