How to convert Number to Words??

Printed From: Crystal Reports Book — Forum Name: Technical Questions

I want to convert number to word in crystal report formula fields.
Suppose the amount is 31500

It should show like:
Thirty One Thousand and Five Hundred

how to do it ?
please help me
ToWords(table.numberfield)
Thanks dear
But I want write function.
How to write function for convert number to words?


I don't understand what you are asking for.
ToWords() is a Crystal function.
It will convert a number to the equivalent word like:
"1" as "one"
or
"31500" as "thirty-one thousand five hundred"
It is not exactly the verbiage you wanted but I think it is works for you.
Unfortunately when I tested it in CR 2013, I noticed that it had the 'and xx/100' at the end of the string (handy for doing checks).  Easy enough to strip off if there are not cents involve.  Also swallow.pa, if you need it proper case, CR can do that too. ProperCase().

So as an example formula:  ProperCase(ToWords({SomenumericField}))


Edited by kevlray - 05 Dec 2016 at 6:57am
Thanks Kevlray, not using 2013...
in XI you can use a condition to choose how many decimal points to include so using a 0 will exclude the 'and x/x' portion. Perhaps that was removed for 2013?
towords(number,0)
Perhaps I did not look at the documentation :-)
Originally posted by DBlank

I don't understand what you are asking for.
ToWords() is a Crystal function.
It will convert a number to the equivalent word like:
"1" as "one"
or
"31500" as "thirty-one thousand five hundred"
It is not exactly the verbiage you wanted but I think it is works for you.


Thanks dear when I use to word I get English result.
But I want Arabic result .
Crystal report does not supported Arabic in towords.
I need create a function that convert number to word by Arabic language
How to do it?

Edited by swallow.pa - 07 Dec 2016 at 4:25pm