Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9159

Re: Amount in words formula alteration in Crystal report 2008

$
0
0

Hi Dwarakanath P

 

{OINV.DocCur}&''&

(

if {OINV.DocCur}='INR' then

(

numbervar RmVal:=0;

numbervar Amt:=0;

numbervar pAmt:=0;

stringvar Inwords :=" ";

numbervar totalAmt;

totalAmt := {OINV.DocTotal};

Amt := totalAmt;

 

if Amt >= 10000000 then

RmVal := truncate(Amt/10000000);

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;

 

RmVal := 0;

if Amt >= 100000 then

RmVal := truncate(Amt/100000);

if RmVal = 1 then

InWords := Inwords + " " + towords(RmVal,0) + " Lakh"

Else

If RmVal > 1 then

InWords := Inwords + " " + ToWords(RmVal,0) + " Lakhs";

Amt := Amt - Rmval * 100000;

 

RmVal := 0;

if Amt >= 1000 then

RmVal := truncate(Amt/1000);

if RmVal =1 then

Inwords := Inwords + " " + towords(RmVal,0) + " Thousand"

Else

if RmVal > 1 then

InWords := Inwords + " " + towords(RmVal,0) + " Thousand";

Amt := Amt - RmVal * 1000;

 

if Amt > 0 then

InWords := Inwords + " " + towords(truncate(Amt),0);

 

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

 

if pAmt > 0 then

InWords := Inwords + " rupees and " + towords(pAmt,0) + " Paisa only"

else

InWords := Inwords + " only";

 

propercase(Inwords)

)

  else

 

ProperCase( towords(tonumber(totext({OINV.DocTotalFC},2,"")),2)

[1 to (instr(towords(tonumber(totext({OINV.DocTotalFC},2,"")),2)," and ") - 1)] +" and  " + towords(tonumber(totext({OINV.DocTotalFC},2,"")

[instr(totext({OINV.DocTotalFC},2,""), ".") + 1 to instr(totext({OINV.DocTotalFC},2,""), ".")

+ 2]))[1 to (instr(towords(tonumber(totext({OINV.DocTotalFC},2,"")

[instr(totext({OINV.DocTotalFC},2,""),".")

+ 1 to instr(totext({OINV.DocTotalFC},2,""), ".") + 2]))," and ") - 1)] + " Cent " + " Only")

)

 

Regards

Kennedy


Viewing all articles
Browse latest Browse all 9159

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>