vb text 科学计数

来源:百度知道 编辑:UC知道 时间:2024/06/15 03:40:39
在text里输入一个比较长的数
执行 text1 = text1 + 1 以后
text里面的数就变成科学计数法显示了
怎么让它禁止显示科学计数法.

很难处理,要用高精度计算才可以,把数值处理成字符,一位一位从个位开始相加。

做了一个高精度加法运算的

Function jia(ByVal st1 As String, ByVal st2 As String) As String
Dim n1 As Long, n2 As Long, i As Long
Dim n3 As Integer
Dim st3 As String

If IsNumeric(st1) And IsNumeric(st2) Then
If Len(st1) < Len(st2) Then
st3 = st1
st1 = st2
st2 = st3
End If
st3 = ""
n1 = Len(st1)
n2 = Len(st2)
For i = n1 To 1 Step -1
If Len(st3) > 1 Then
n3 = Left(st3, 1)
Else
n3 = 0
End If
If i - n1 + n2 > 0 Then
st3 = Val(Mid(st1, i, 1)) + Val(Mid(st2, i - n1 + n2, 1)) + n3
jia = Right(st3, 1) & jia
Else
st3 = Val(Mid(st1, i, 1)) + n3