# Cheque Print through Crystal Report – Indian localization

I am working in SAP B One 9.0 PL 12 and till now did not find any clear solution for cheque printing in the same. There are many functions on internet for the same but every one has flaws itself. sometime it shows lacks for lakh , shows “And”  unnecessary at the end  etc. Now you can find right formula below

// formula to convert the amount in words as per Indian standard

numbervar RmVal:=0;

numbervar Amt:=0;

numbervar pAmt:=0;

stringvar InWords :=” “;

Amt := (cdbl({Command.CheckSum}));

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 and Amt >100000 then

InWords := InWords + ” ” + towords(RmVal,0) + ” lakhs”

else if  RmVal =1 and Amt >100000 then

InWords := InWords + ” ” + towords(RmVal,0) + ” lakh”

else if Amt>0 then

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

Amt := Amt – Rmval * 100000;

if Amt > 0 and  RmVal >=1 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)

// End