12,396,230 members (69,537 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 130 ppolymorphe 95 BillWoodruff 70 Jochen Arndt 65 RossMW 65
 OriginalGriff 6,128 ppolymorphe 2,445 Karthik Bangalore 2,382 F-ES Sitecore 1,877 Richard MacCutchan 1,752