Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Convert Numbers to Arabic Language Text

Hello All,

There is code available for converting a number to its equivalent
English Text. (Like 1= "One")
Do any one here have a code to convert numbers to Arabic Language Text?

Thanks

Abdul

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Convert Numbers to Arabic Language Text

Abdul,

A lot depends on the word structure in Arabic. For example, I helped someone convert the standard
'number to word' function to Italian, which has different words depending on the level - for
example, "unmilione" for 1 million, and "milioni" for multiples. I have copied the code for the
Italian conversion below - you would basically need to change each quoted value to the appropriate
word in Arabic. (That, I can't help you with.) But if there is additional structure needed in the
function, post back, and I can help you with that.

The function, as written, is used like

=Conversion(A1)

where A1 has a number that needs to be converted to words.

HTH,
Bernie
MS Excel MVP


Function conversion(inRange As Range) As String

conversion = ""

n = inRange.Value

'Do Billions
bill = n / 1000000000
If Int(bill) 0 Then
If Int(bill) = 1 And ((Int(bill) - bill) < 0) Then
conversion = "unmiliardo"
Else
conversion = MakeWord(Int(bill)) & "miliardi"
End If
End If

'Do millions
n = n - Int(bill) * 1000000000
mill = n / 1000000
If Int(mill) 0 Then
If Int(mill) = 1 And ((Int(mill) - mill) < 0) Then
conversion = "unmilione"
Else
conversion = conversion & MakeWord(Int(mill)) & "milioni"
End If
End If

'Do Thousands
n = n - Int(mill) * 1000000
thou = n / 1000
If Int(thou) 0 Then
If Int(thou) = 1 And ((Int(thou) - thou) < 0) Then
conversion = "mille"
Else
conversion = conversion & MakeWord(Int(thou)) & "mila"
End If
End If

'Do the rest
n = n - Int(thou) * 1000
conversion = conversion & MakeWord(Int(n))

conversion = Application.WorksheetFunction.Proper(Trim(conversi on))
End Function

Function MakeWord(inValue As Integer) As String
'Enter the counting words: one, two, three... up to 19
unitWord = Array("", "uno", "due", "tre", "quattro", "cinque", _
"sei", "sette", "otto", "nove", "dieci", "undici", _
"dodici", "tredici", "quattordici", "quindici", "sedici", _
"diciassette", "diciotto", "diciannove")
'enter the decade words - 10, 20, etc.
tenWord = Array("", "dieci", "venti", "trenta", "quaranta", "cinquanta", _
"sessanta", "settanta", "ottanta", "novanta")
MakeWord = ""
n = inValue
If n = 0 Then
MakeWord = ""
End If

'Do the nundreds
hund = n \ 100
If hund 0 Then
If hund = 1 Then
MakeWord = MakeWord & "cento"
Else
MakeWord = MakeWord & unitWord(hund) & "cento"
End If
End If
n = n - hund * 100
If n < 20 Then
ten = n
MakeWord = MakeWord & unitWord(ten) & ""
Else
ten = n \ 10
MakeWord = MakeWord & tenWord(ten) & ""
unit = n - ten * 10
MakeWord = Trim(MakeWord & unitWord(unit))
End If
MakeWord = Application.WorksheetFunction.Proper(Trim(MakeWord ))
End Function


"Abdul" wrote in message
oups.com...
Hello All,

There is code available for converting a number to its equivalent
English Text. (Like 1= "One")
Do any one here have a code to convert numbers to Arabic Language Text?

Thanks

Abdul



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to convert arabic numbers to english text format in excel? ANURAG ARPAN Excel Worksheet Functions 2 March 4th 15 06:34 AM
convert arbic numbers to arabic text Sameh Excel Worksheet Functions 0 November 19th 06 10:28 PM
How do you convert Arabic numbers to English text format? amt0423 Excel Discussion (Misc queries) 2 August 2nd 06 07:24 AM
How can I convert Arabic numbers to English text format in EXCEL Excel problem Excel Discussion (Misc queries) 0 June 7th 06 04:39 AM
How do I convert Arabic numbers into a spellout text Widodo Excel Worksheet Functions 1 April 11th 05 12:10 PM


All times are GMT +1. The time now is 05:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"