cancel
Showing results for 
Search instead for 
Did you mean: 

Currency Amount In Words

Former Member
0 Kudos

Hi,

Using Crystal Reports 2008, and want to convert $202.00 to "Two Hundred Two and 00/100 Dollars"

When I try:

ToWords({CheckSum}), I get "two hundred two and xx/100 Dollars"

REPLACE(ToWords({CheckSum}), "xx/", "00/"), I still get "two hundred two and xx/100 Dollars" and xx does not convert to zeros.

PROPER(ToWords({CheckSum})), I get "Two Hundred Two And Xx/100 Dollars"

How do I get the format I want?

Thanks,

Ajay Audich

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Ajay,

Use this formula instead:

numbervar x := {number_field};

numbervar ipart;

numbervar decpart;

ipart := int(x) ;

decpart := x - ipart;

ProperCase(replace(towords(ipart),"and xx / 100","")&"and "&mid(totext(decpart),instr(totext(decpart),".")+1,len(totext(decpart)))&" / 100 Dollars");

Hope this helps!

- Abhilash

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Answers (0)