13,044,115 members (83,581 online)
Rate this:
See more:
i am using towords() function to convert amount to words
value=6400

towards(value,0)

i am getting output like "six thousand four hundred "

but i want with decimal also

if value goes like this 6400.75 then i neeed

"six thousand four hundred and seventy paise"
Posted 19-Mar-13 23:36pm

Rate this:

## Solution 1

HI,

try like below.
`Towords(truncate(6400.75), 0) + " Rupees and " + towords(abs(100 * (truncate(6400.75)- 6400.75)), 0) + "Paise";`

result is: six thousand four hundred Rupees and seventy five paise

The first part i.e.
`Towords(truncate(6400.75), 0) `

returns 6400, and will ignore the decimal place.

Second part i.e.
`(abs(100 * (6400.75 - truncate(6400.75))`

converts it to a positive value and multiplies the value to be non decimal.

If you have more decimal places you'll have to adjust the 100 multiplier.

hope it helps.
v2

Top Experts
Last 24hrsThis month
 OriginalGriff 230 ppolymorphe 140 Sheila Pontes 105 LuxGiammi 80 Afzaal Ahmad Zeeshan 70
 OriginalGriff 4,420 RickZeeland 1,834 ppolymorphe 1,574 F-ES Sitecore 1,553 Dave Kreskowiak 1,309