ANAYA NOOR IMPORT & EXPORT PVT LTD
Perfume Industry Best Source
Perfume Industry Best Source
ORDER |
Screen Printing INK WG-2180 |
Option Explicit
'Main Function Function SpellNum_Dirham(ByVal MyNumber) Dim Dirham, Fils, Temp Dim DecimalPlace, Count ReDim Place(9) As String Place(2) = " Thousand " Place(3) = " Million " Place(4) = " Billion " Place(5) = " Trillion " ' String representation of amount. MyNumber = Trim(Str(MyNumber)) ' Position of decimal place 0 if none. DecimalPlace = InStr(MyNumber, ".") ' Convert Fils and set MyNumber to dollar amount. If DecimalPlace > 0 Then Fils = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _ "00", 2)) MyNumber = Trim(Left(MyNumber, DecimalPlace - 1)) End If Count = 1 Do While MyNumber <> "" Temp = GetHundreds(Right(MyNumber, 3)) If Temp <> "" Then Dirham = Temp & Place(Count) & Dirham If Len(MyNumber) > 3 Then MyNumber = Left(MyNumber, Len(MyNumber) - 3) Else MyNumber = "" End If Count = Count + 1 Loop Select Case Dirham Case "" Dirham = "No Dirham" Case "One" Dirham = "One Dollar" Case Else Dirham = Dirham & " Dirham" End Select Select Case Fils Case "" Fils = " and No Fils" Case "One" Fils = " and One Cent" Case Else Fils = " and " & Fils & " Fils" End Select SpellNum_Dirham = Dirham & Fils End Function |