Currency format Display number

Source: Internet
Author: User
Tags format split
Currency | show

The following is the source code:
function Formatcur (cur,v)
Dim curd
If InStr (cur, ".") >0 Then
Curd = Split (cur, ".") (1)
cur = split (cur, ".") (0)
Else
Curd = "00"
End If
If V=0 Then
If Cur=0 Then
formatcur= "<font color= ' #cccccc ' >-</font>"
Else
v9=cur& ""
Va=len (V9)
If Va<4 Then
V2=v9
Else
Yi=fix (VA/3)
Y2= (yi+1) *3
t1=3-(Y2-VA) +1
If YI&LT;&GT;VA/3 Then
E2= ""
For I=1 to Yi
V2= "," &mid (v9,t1+3* (i-1), 3)
E2=e2+v2
Next
V2=mid (v9,1, (va-3*yi)) &e2
Else
E2= ""
For y=2 to Yi
V2= "," &mid (V9, (y-1) *3+1,3)
E2=e2+v2
Next
V2=mid (v9,1,3) &e2
End If
End If
Formatcur=v2
End If
Else
If Cur=0 Then
formatcur= "<font color= ' #cccccc ' >-</font>"
Else
Formatcur=formatcurrency (cur)
End If
End If
If curd<> "" and cur<>0 Then
If Len (curd) <2 Then
Curd = curd & "0"
End If
Formatcur = Formatcur & "." & Curd
End If
End Function



Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.