ASP.net (VB) to achieve the amount of money converted to uppercase function _ practical tips

Source: Internet
Author: User
Copy Code code as follows:

"' <summary>
"Converts data to double numbers
"' </summary>
' <param name= ' Obj ' ></param>
"' <returns></returns>
"' <remarks></remarks>
Public Shared Function Todbl (ByVal Obj as Object) as Double
If OBJ is DBNull.Value Then
return 0
ElseIf IsNumeric (OBJ) = False Then
return 0
Else
Return OBJ
End If
End Function

Copy Code code as follows:
' <summary>
' converts the amount to uppercase
' ' </summary>
' &L T;param name= "Money" > Amount </param>
' <returns></returns>
' <remarks></ remarks>
Public Shared Function Uppermoney (ByVal Money As String) As String
, Todbl (Money). ToString ("0.00")
Dim Strfushu as String = IIf (Money.startswith ("-"), "negative", "")
Money = Money.replace ("-", ""). R Eplace (".", "")
Dim number As String = "0 One Woolu seven ba"
Dim Unit As String = "cent thousand thousand hundred thousand thousand million to pick up"
Dim str As St Ring
for i As Integer = 0 to Money.length-1
Dim c as String = Money.chars (i)
Dim Index As Integer = Mo Ney. Length-1-I
Str &= number (c) & Unit (Index)
Next
str = strfushu & str & "whole"
Retu RN Str
End Function
Related Article

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.