How to convert Number to Words??
Printed From: Crystal Reports Book — Forum Name: Technical Questions
Posted By: swallow.pa — 28 Nov 2016 at 10:00pm
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
Posted By: DBlank — 29 Nov 2016 at 8:25am
ToWords(table.numberfield)
Posted By: swallow.pa — 5 Dec 2016 at 4:24am
Thanks dear
But I want write function.
How to write function for convert number to words?
Posted By: DBlank — 5 Dec 2016 at 6:29am
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.
Posted By: kevlray — 5 Dec 2016 at 6:53am
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
Posted By: DBlank — 5 Dec 2016 at 6:59am
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)
Posted By: kevlray — 5 Dec 2016 at 9:28am
Perhaps I did not look at the documentation :-)
Posted By: swallow.pa — 7 Dec 2016 at 4:24pm
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
|