Code for converting "Number format" of rupees in to "Word format"

This is a simple code for converting number format of rupees in to word format within crystal report .I struggled a lot to get this code. So am posting this to you my friends..


Eg : 5632 To ---- five thousand six hundred and thirty two only


Wirte the below code in Formula Editor and drag the formula to crystal report section




numbervar RmVal:=0;
numbervar Amt:=0;
numbervar pAmt:=0;
stringvar InWords :="Rs. ";
Amt := {PURCHASE_ORDER_MASTER.NetTotal} ;
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 Amt =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";
LOWERCASE(InWords)


Comments

Guest Author: Nitin22 May 2012

i use this code in my crystal report 4.0 but
when i preview this report then display error CRXLAT32.DLL. Any solution . pl send me mail nitingw@gmail.com



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: