Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to convert Number to Words?? Post Reply Post New Topic
Author Message
swallow.pa
Newbie
Newbie


Joined: 26 Apr 2012
Online Status: Offline
Posts: 26
Quote swallow.pa Replybullet Topic: How to convert Number to Words??
    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
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Nov 2016 at 8:25am
ToWords(table.numberfield)
IP IP Logged
swallow.pa
Newbie
Newbie


Joined: 26 Apr 2012
Online Status: Offline
Posts: 26
Quote swallow.pa Replybullet Posted: 05 Dec 2016 at 4:24am
Thanks dear
But I want write function.
How to write function for convert number to words?


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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 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
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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)
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 05 Dec 2016 at 9:28am
Perhaps I did not look at the documentation :-)
IP IP Logged
swallow.pa
Newbie
Newbie


Joined: 26 Apr 2012
Online Status: Offline
Posts: 26
Quote swallow.pa Replybullet 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?

Edited by swallow.pa - 07 Dec 2016 at 4:25pm
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.039 seconds.