Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

am developing my Windows application using C#.net...In that,I have a problem with currency conversion function TOWORDS(), if the currency is below 100,000 is giving the correct.if the currency is above 100,000 then it is taking the default US $ format..means million,but i am generating report to indian Client,how to use a custom function to convert currency in indian format
ex: 100,000(i am getting : one hundread thousand)
but i want to get (one lack )...how i get this...plz help out of this
Posted

Finally I get Solution for this....

Create New Formula Field..In that Paste the following Code...Its Works.

numbervar RmVal:=0;
numbervar Amt:=0;
numbervar pAmt:=0;
stringvar InWords :="Rupees ";

Amt := type your value ; // 25,12,000


if Amt > 10000000 then RmVal := truncate(Amt/10000000);
if Amt = 10000000 then RmVal := 1;

if RmVal = 1 then
InWords := InWords + " " + towords(RmVal,0) + " crore"
else
if RmVal > 1 then InWords := InWords + " " + towords(RmVal,0) + " crores";


Amt := Amt - Rmval * 10000000;

if Amt > 100000 then RmVal := truncate(Amt/100000);
if Amt = 100000 then RmVal := 1;

if RmVal = 1 then
InWords := InWords + " " + towords(RmVal,0) + " lakhs"
Else
If RmVal > 1 then InWords := InWords + " " + ToWords(RmVal,0) + "Lakhs";

Amt := Amt - Rmval * 100000;

if Amt > 0 then InWords := InWords + " " + towords(truncate(Amt),0);

pAmt := (Amt - truncate(Amt)) * 100;

if pAmt > 0 then
InWords := InWords + " and " + towords(pAmt,0) + " paisa only"
else
InWords := InWords + " only";

UPPERCASE(InWords)
 
Share this answer
 
Comments
Surendra0x2 24-Dec-13 2:30am    
Thanks Buddy You Saved My ass :)
 
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