Click here to Skip to main content
15,896,727 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
i tried to convert amount in words as Indian currency but in case of amount is in lacs
or above conversion is not properly.

My formula in CR is:

1.

formula= Towords(truncate(890010.89), 0) + " and " + towords(abs(100 * (truncate(890010.89)- 890010.89)), 0) + " centavos";


2.

local stringvar sNumber := cstr(Sum (890010.89));
local numbervar whole := truncate(Sum (890010.89));
local numbervar pos := instrrev(sNumber, '.');
local numbervar decimal := 0;

if pos > 0 then
(
decimal := CDbl(right(sNumber, length(sNumber) - pos));
);

Uppercase(ToWords(whole, 0) + ' Rupee(s) and ' + ToWords(decimal, 0) + ' Paise Only');


Note: Above formulas working properly upon thousands but for thousands above not working...

Please help me for proper conversion either in terms of lacs or above..
Posted

1 solution

 
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