Saturday, May 14, 2011

Crystal Reports ToWords() and Propercase() function

I have to convert amount into words like 2150 to two thousand and fifty only .
for achieving this i have used towords() function in crystal report,



i have just create new formula

ToWords({abc.amount},0)+" Only"
 it returns me result but in lower case so i have converted into upperCase  like this
UpperCase(towords({abc.amount},0)) +" Only"
it returns me TWO THOUSAND AND FIFTY ONLY but i need First letter capital of every word
then i used
ProperCase(ToWord({abc.amount},0)+" Only"

ProperCase() give me following result

Two Thousand And Fifty Only

Hope it will help someone :)
HappyCoding :)

1 comment:

  1. If i use this formula , the amount of 1111.78 will show out "one thousand one hundred twelve and Cents seventy-eight Only"

    Some How modify it for me

    Thank you in advance.

    ReplyDelete