If any one can can help me out with a function or module to convert numbers to words in the Indian system of numerals..........
Like 1,24,53,432 will read as one crore twenty four lakhs fifty three thousand four hundred and thirty two.
10 10432 PEB 1,418
Recognized Expert Top Contributor
Ehha! The regional settings also can't help you!
And this have to be string!!! And not number!
PEB 1,418
Recognized Expert Top Contributor
So the virgulas are after the first 3 numbers from the right and 2 after each next couple isn't it?
PEB 1,418
Recognized Expert Top Contributor
And this number is it good?
24,86,54,54,421
And when there is a decimals what are you doing? You use the . maybe like this:
24,86,54,54,421.56 ?
And this number is it good?
24,86,54,54,421
And when there is a decimals what are you doing? You use the . maybe like this:
24,86,54,54,421.56 ?
-----------------
Yes you are right. A brief intro to the Indian number system is shown below :
Indian numbering system is used today in India, Pakistan, Bangladesh, and Myanmar (Burma) and is based on a unique grouping of 2 decimal places, rather than the 3 decimal places commonplace in the West (China and Japan, for instance, use 4). The terms crore and lakh are in widespread use today in Indian English.
The table below follows the short scale usage of billion being a thousand million. In India, following British usage, the long scale was used, with one billion equivalent to a million million.
India's unique number system
Term Figure No of zeros Western system (short scale)
lakh (lac) 1,00,000 5 100,000 (One hundred thousand)
crore 1,00,00,000 7 10,000,000 (Ten million)
arab 1,00,00,00,000 9 1,000,000,000 (One billion)
kharab 1,00,00,00,00,000 11 100,000,000,000 (One hundred billion)
neel 1,00,00,00,00,00,000 13 10,000,000,000,000 (Ten trillion)
padma 1,00,00,00,00,00,00,000 15 1,000,000,000,000,000 (One
quadrillion)
PEB 1,418
Recognized Expert Top Contributor
-----------------
Yes you are right. A brief intro to the Indian number system is shown below :
Indian numbering system is used today in India, Pakistan, Bangladesh, and Myanmar (Burma) and is based on a unique grouping of 2 decimal places, rather than the 3 decimal places commonplace in the West (China and Japan, for instance, use 4). The terms crore and lakh are in widespread use today in Indian English.
The table below follows the short scale usage of billion being a thousand million. In India, following British usage, the long scale was used, with one billion equivalent to a million million.
India's unique number system
Term Figure No of zeros Western system (short scale)
lakh (lac) 1,00,000 5 100,000 (One hundred thousand)
crore 1,00,00,000 7 10,000,000 (Ten million)
arab 1,00,00,00,000 9 1,000,000,000 (One billion)
kharab 1,00,00,00,00,000 11 100,000,000,000 (One hundred billion)
neel 1,00,00,00,00,00,000 13 10,000,000,000,000 (Ten trillion)
padma 1,00,00,00,00,00,00,000 15 1,000,000,000,000,000 (One
quadrillion)
Ok!
Espessially for you I've wrote this code! Try it and say if it is good! :) -
Function indian_number(my_number) As String
-
Dim result As String
-
Dim new_result As String
-
Dim i As Integer
-
Dim last_i As Integer
-
result = my_number
-
result = Replace(result, ",", ".")
-
'Stop
-
If InStr(1, result, ".") Then
-
new_result = Mid(result, InStr(1, result, "."), Len(result) - InStr(1, result, ".") + 1)
-
result = Mid(result, 1, InStr(1, result, ".") - 1)
-
End If
-
-
For i = 1 To Len(result)
-
If (i = 3) And Len(result) > 3 Then
-
new_result = "," + Mid(result, Len(result) - 2, Len(result)) + new_result
-
last_i = i
-
End If
-
If (i > 3) And (Len(result) > i) And ((i Mod 2) > 0) Then
-
new_result = "," + Mid(result, Len(result) - i + 1, i - last_i) + new_result
-
last_i = i
-
End If
-
Next i
-
new_result = Mid(result, 1, Len(result) - last_i) + new_result
-
indian_number = new_result
-
End Function
-
Have a nice day!
:)
PEB 1,418
Recognized Expert Top Contributor
Or you are searching a code that says the numbers with words?
I have mine in bulgarian...
but in English!!!
PEB 1,418
Recognized Expert Top Contributor
IF is it your need I can write you the code but it's difficult and takes as well as 10 -12 hours!
It's better to search in the net!
IF you find a code that says the numbers in English maybe I could retreat it to display the numbers in indian English!
:)
PEB 1,418
Recognized Expert Top Contributor
Type the following code into the module sheet. -
Option Explicit
-
-
'****************
-
' Main Function *
-
'****************
-
-
Function SpellNumber(ByVal MyNumber)
-
Dim Dollars, Cents, 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 cents and set MyNumber to dollar amount.
-
If DecimalPlace > 0 Then
-
Cents = 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 Dollars = Temp & Place(Count) & Dollars
-
If Len(MyNumber) > 3 Then
-
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
-
Else
-
MyNumber = ""
-
End If
-
Count = Count + 1
-
Loop
-
-
Select Case Dollars
-
Case ""
-
Dollars = "No Dollars"
-
Case "One"
-
Dollars = "One Dollar"
-
Case Else
-
Dollars = Dollars & " Dollars"
-
End Select
-
-
Select Case Cents
-
Case ""
-
Cents = " and No Cents"
-
Case "One"
-
Cents = " and One Cent"
-
Case Else
-
Cents = " and " & Cents & " Cents"
-
End Select
-
-
SpellNumber = Dollars & Cents
-
End Function
-
-
-
-
'*******************************************
-
' Converts a number from 100-999 into text *
-
'*******************************************
-
-
Function GetHundreds(ByVal MyNumber)
-
Dim Result As String
-
-
If Val(MyNumber) = 0 Then Exit Function
-
MyNumber = Right("000" & MyNumber, 3)
-
-
' Convert the hundreds place.
-
If Mid(MyNumber, 1, 1) <> "0" Then
-
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
-
End If
-
-
' Convert the tens and ones place.
-
If Mid(MyNumber, 2, 1) <> "0" Then
-
Result = Result & GetTens(Mid(MyNumber, 2))
-
Else
-
Result = Result & GetDigit(Mid(MyNumber, 3))
-
End If
-
-
GetHundreds = Result
-
End Function
-
-
-
-
'*********************************************
-
' Converts a number from 10 to 99 into text. *
-
'*********************************************
-
-
Function GetTens(TensText)
-
Dim Result As String
-
-
Result = "" ' Null out the temporary function value.
-
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
-
Select Case Val(TensText)
-
Case 10: Result = "Ten"
-
Case 11: Result = "Eleven"
-
Case 12: Result = "Twelve"
-
Case 13: Result = "Thirteen"
-
Case 14: Result = "Fourteen"
-
Case 15: Result = "Fifteen"
-
Case 16: Result = "Sixteen"
-
Case 17: Result = "Seventeen"
-
Case 18: Result = "Eighteen"
-
Case 19: Result = "Nineteen"
-
Case Else
-
End Select
-
Else ' If value between 20-99...
-
Select Case Val(Left(TensText, 1))
-
Case 2: Result = "Twenty "
-
Case 3: Result = "Thirty "
-
Case 4: Result = "Forty "
-
Case 5: Result = "Fifty "
-
Case 6: Result = "Sixty "
-
Case 7: Result = "Seventy "
-
Case 8: Result = "Eighty "
-
Case 9: Result = "Ninety "
-
Case Else
-
End Select
-
Result = Result & GetDigit _
-
(Right(TensText, 1)) ' Retrieve ones place.
-
End If
-
GetTens = Result
-
End Function
-
-
-
-
-
'*******************************************
-
' Converts a number from 1 to 9 into text. *
-
'*******************************************
-
-
Function GetDigit(Digit)
-
Select Case Val(Digit)
-
Case 1: GetDigit = "One"
-
Case 2: GetDigit = "Two"
-
Case 3: GetDigit = "Three"
-
Case 4: GetDigit = "Four"
-
Case 5: GetDigit = "Five"
-
Case 6: GetDigit = "Six"
-
Case 7: GetDigit = "Seven"
-
Case 8: GetDigit = "Eight"
-
Case 9: GetDigit = "Nine"
-
Case Else: GetDigit = ""
-
End Select
-
End Function
-
-
So it is easy to change your manner of spelling isn't it?
:)
Ok!
Espessially for you I've wrote this code! Try it and say if it is good! :) -
Function indian_number(my_number) As String
-
Dim result As String
-
Dim new_result As String
-
Dim i As Integer
-
Dim last_i As Integer
-
result = my_number
-
result = Replace(result, ",", ".")
-
'Stop
-
If InStr(1, result, ".") Then
-
new_result = Mid(result, InStr(1, result, "."), Len(result) - InStr(1, result, ".") + 1)
-
result = Mid(result, 1, InStr(1, result, ".") - 1)
-
End If
-
-
For i = 1 To Len(result)
-
If (i = 3) And Len(result) > 3 Then
-
new_result = "," + Mid(result, Len(result) - 2, Len(result)) + new_result
-
last_i = i
-
End If
-
If (i > 3) And (Len(result) > i) And ((i Mod 2) > 0) Then
-
new_result = "," + Mid(result, Len(result) - i + 1, i - last_i) + new_result
-
last_i = i
-
End If
-
Next i
-
new_result = Mid(result, 1, Len(result) - last_i) + new_result
-
indian_number = new_result
-
End Function
-
Have a nice day!
:)
********************
Sorry, doesn't work.
Any way thanks.
got the code in another site codeproject.com and tip-teks.com
PEB 1,418
Recognized Expert Top Contributor
This code is to vizualize the number like 12.23.65.985
and not to tell you the number in words...
The code bellow is to convert the numbers in words... It is the same as in the others sites...
:)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Klaus Neuner |
last post by:
Hello,
I need a function that converts a list into a set of regexes. Like so:
string_list =
print string_list2regexes(string_list)
This should return something like:
|
by: Phil Stanton |
last post by:
When designing a new form or report, the Default ForeColor is often
something like -2147483640 which is the colour of Windows text (possibly
black) and the default backColor is -2147483643...
|
by: Abhishek Jha |
last post by:
How can we write a shortest program in c to convert given number to
words format. example input 5012 Output: five thousand tewlve.
|
by: egoldthwait |
last post by:
I need to convert a 17mb access 2000 db to Oracle and house it in a
Citrix farm. The issue: we have never converted an Access Db to Oracle
but can probably use Oracle's Workbench to assist with...
|
by: Bob Homes |
last post by:
In VB6, foreground and background colors of controls had to be assigned a
single number. If you knew the RGB values for the color, you still had to
convert them into the single number accepatable...
| |
by: bijondhanbad |
last post by:
If any one can can help me out with a function or module in MS Access to convert numbers to words in the Indian system of numerals..........
Like 1,24,53,432 will read as one crore twenty four lakhs...
|
by: activeashish |
last post by:
my present MYSQL server is storing current time not as an indian time
can any one help me in converting this time to indian time
either through php or mysql
|
by: mpurnachary |
last post by:
Hi...
Plz... Help me...
I want some code for Converting a Number (money) to Words in Indian Format in C#.NET
eg.: if I enter 12345678 then it gives as ...
" ONE CRORE TWENTY...
|
by: sandeep2 |
last post by:
how to convert the numbers into words in asp.net using c#,please help me,its very urgent....?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |