When you do some kind of data display is not often encountered such a situation, too large numbers are displayed as a scientific notation, and more than a decimal display. 555 This, very unattractive, you can use the following small function to do it
function Sonic (Tnum)
If CSng (tnum) >0 Then
Getlar=0
If InStr (Tnum, "E") >1 Then
tnum=tnum/10000
Getlar=1
Else
If InStr (Tnum, ".") <1 Then
Tnum=cstr (Tnum) & "."
End If
If InStr (Tnum, ".") =1 Then
tnum= "0" +cstr (tnum)
End If
End If
If Getlar=0 Then
Sonic=left (tnum&), InStr (Tnum, ".") +2)
Else
Sonic=left (tnum&), InStr (Tnum, ".") +2) + "million"
End If
ElseIf CSng (tnum) <0 Then
Tnum=-csng (Tnum)
If InStr (Tnum, ".") <1 Then
Tnum=cstr (Tnum) & "."
End If
If InStr (Tnum, ".") =1 Then
tnum= "0" +cstr (tnum)
End If
Sonic= "-" &left (tnum& ")", InStr (Tnum, ".") +2)
Else
Sonic= "0.00"
End If
End Function
It's pretty simple, huh?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service