Speedup your Openoffice.
Saturday, February 7, 2009
Subscribe to:
Post Comments (Atom)
Open Office Fan Club is a community blog set up for the purpose of making OpenOffice.org for windows a more popular and also to cater to the needs of many fellow users. We aim to create a open users community.
1 comment:
thanks openoffice.org fan club
i used this macro program to convert amount in figures to amount in words, except i make some revisions like the decimal point is still numeric:
just wanna share this, here's how:
**** copy from line below *****
Sub Main
Print RUPEES( 123456789.12 )
End Sub
Function RUPEES( ByVal nNumber As Double ) As String
cWords = ""
nDigit = 0.00
If nNumber < 0 Then
cWords = "Negative " + RUPEES( -1 * nNumber )
ElseIf nNumber <> Int( nNumber ) Then
cWords = RUPEES( Int( nNumber ) )
cWords = cWords + " and "
nFrac = nNumber - Int( nNumber )
' Do
nFrac = nFrac * 100
nDigit = Int( nFrac )
' nFrac = nFrac - nDigit
If nDigit > 0 Then
cDigitWord = RUPEES (nDigit )
cWords = cWords + " " + nDigit + " /100"
' Else
' Exit Do
EndIf
' Loop
ElseIf nNumber < 20 Then
Select Case nNumber
Case 0: cWords = "Zero"
Case 1: cWords = "One"
Case 2: cWords = "Two"
Case 3: cWords = "Three"
Case 4: cWords = "Four"
Case 5: cWords = "Five"
Case 6: cWords = "Six"
Case 7: cWords = "Seven"
Case 8: cWords = "Eight"
Case 9: cWords = "Nine"
Case 10: cWords = "Ten"
Case 11: cWords = "Eleven"
Case 12: cWords = "Twelve"
Case 13: cWords = "Thirteen"
Case 14: cWords = "Fourteen"
Case 15: cWords = "Fifteen"
Case 16: cWords = "Sixteen"
Case 17: cWords = "Seventeen"
Case 18: cWords = "Eighteen"
Case 19: cWords = "Ninteen"
End Select
ElseIf nNumber < 100 Then
nTensPlace = Int( nNumber / 10 )
nOnesPlace = nNumber Mod 10
Select Case nTensPlace * 10
Case 20: cWords = "Twenty"
Case 30: cWords = "Thirty"
Case 40: cWords = "Forty"
Case 50: cWords = "Fifty"
Case 60: cWords = "Sixty"
Case 70: cWords = "Seventy"
Case 80: cWords = "Eighty"
Case 90: cWords = "Ninty"
End Select
If nOnesPlace > 0 Then
cWords = cWords + " " + RUPEES( nOnesPlace )
EndIf
ElseIf nNumber < 1000 Then
nHundredsPlace = Int( nNumber / 100 )
nRest = nNumber Mod 100
cWords = RUPEES( nHundredsPlace )
cWords = cWords + " Hundred"
If nRest > 0 Then
cWords = cWords + " " + RUPEES( nRest )
EndIf
ElseIf nNumber < 100000 Then
nThousands = Int( nNumber / 1000 )
nRest = nNumber Mod 1000
cWords = RUPEES( nThousands )
cWords = cWords + " Thousand"
If nRest > 0 Then
cWords = cWords + " " + RUPEES( nRest )
EndIf
ElseIf nNumber < 10000000 Then
nMillions = Int( nNumber / 100000 )
nRest = Int( nNumber Mod 100000 )
cWords = RUPEES( nMillions )
cWords = cWords + " Hundred"
If nRest > 0 Then
cWords = cWords + " " + RUPEES( nRest )
EndIf
ElseIf nNumber < 1000000000 Then
nBillions = Int( nNumber / 1000000 )
nRest = Int( nNumber Mod 1000000 )
cWords = RUPEES( nBillions )
cWords = cWords + " Million"
If nRest > 0 Then
cWords = cWords + " " + RUPEES( nRest )
EndIf
' You can follow the pattern of the Millions / Billions / Trillions
' if you need bigger numbers.
EndIf
RUPEES() = cWords
End Function
**** end here *****
Post a Comment