asp.Net(vb)実装金額を大文字に変換する関数

1537 ワード

 
  
'''
''' Double
'''

'''
'''
'''
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
 
  
'''
'''
'''

'''
'''
'''
Public Shared Function UpperMoney(ByVal Money As String) As String
Money = todbl(Money).ToString("0.00")
Dim strFuShu As String = IIf(Money.StartsWith("-"), " ", "")
Money = Money.Replace("-", "").Replace(".", "")
Dim Number As String = " "
Dim Unit As String = " "
Dim str As String
For i As Integer = 0 To Money.Length - 1
Dim c As String = Money.Chars(i)
Dim Index As Integer = Money.Length - 1 - i
str &= Number(c) & Unit(Index)
Next
str = strFuShu & str & " "
Return str
End Function