Print Page | Close Window

How to convert Number to Words??

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22159
Printed Date: 03 May 2024 at 10:20am


Topic: How to convert Number to Words??
Posted By: swallow.pa
Subject: How to convert Number to Words??
Date Posted: 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



Replies:
Posted By: DBlank
Date Posted: 29 Nov 2016 at 8:25am
ToWords(table.numberfield)


Posted By: swallow.pa
Date Posted: 05 Dec 2016 at 4:24am
Thanks dear
But I want write function.
How to write function for convert number to words?




Posted By: DBlank
Date Posted: 05 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
Date Posted: 05 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 http://www.crystalreportsbook.com/forum/member_profile.asp?PF=15263&FID=7 - swallow.pa , if you need it proper case, CR can do that too. ProperCase().

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


Posted By: DBlank
Date Posted: 05 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
Date Posted: 05 Dec 2016 at 9:28am
Perhaps I did not look at the documentation :-)


Posted By: swallow.pa
Date Posted: 07 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?



Print Page | Close Window