Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How we can Show integer value into Words,

Eg. When we buy some product at e-commerce shop or Malls we get receipt for our payment.
if the product cost is Rs 100 then on receipt Amount is given in Integer - Rs 100 &
and also Amount in words - Rupees One hundred Only.

how Amount in Words is calculated from Integer to Words ?
sometimes even decimal also come in amount.

how to achieve this

Amount | Words
Rs 100 | One Hundred
Rs 250.45| Two Hundred Fifty and Forty Five Paise
Posted
Comments
BillWoodruff 20-Nov-14 9:41am    
I'd like to help you with this in a way where you learn the most on your own: how far are you along with this; what have you tried ? Can you post some code ? Is this homework, or are you doing this "for yourself" ?

How "high" a Rupee value do you wish this translator to work with: include 'Arab and 'Kharab ?
Tarun Jaiswal 21-Nov-14 1:11am    
this is not a Home Work, it is a curiosity to learn how this action is performed is there any in-built classes or every developer have to implement his own logic to achieve this Task.
& I currently did not understand how the value is calculated becaused i read some Articles on Internet there they say to create table with all numerical digit, some say go on dividing numbers with total digit count. I dont have a proper Logic how to calculate it.
Currently my required value upto Lakh only.
Thanks for your reply

1 solution

you would have to create table to store the definition of each number and i.e.

Number and the word mapped to it.

e.g. 11="ELEVEN"

Refer below.

sql-server-query-to-convert-numbers[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900