on 11-13-2012 9:11 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.