Friday, February 24, 2012

How can I get digit into words in crystal report

Hi Everybody
How can I get digit into words in crystal report...
for examble
"102" in to
"hundred and two"
By RajeshHi Rajesh,

I think this code will work for you.

Function (currencyVar v1)
Local CurrencyVar RoundCents := round(remainder(v1,1)*100);
Local Stringvar Dollarpart := towords(int(v1),0);
Local Stringvar Centspart := towords(int(RoundCents),0);
if instr(dollarpart, "hundred") > 0
then dollarpart := Replace (dollarpart,"hundred" ,"hundred and" );
dollarpart + " dollars and " + centspart + " cents"

No comments:

Post a Comment