Joined: 31 Jan 2008
Location: Australia
Online Status: Offline
Posts: 2
Topic: number to words Posted: 31 Jan 2008 at 2:49pm
Hi,
I am facing a problem of converting numbers into words/english. The function ToWords() doesn't do what i need to do. for example, the value 135, ToWords function will translates into "one hundred thrity-five". But i want "one hundred and thirty-five". Is there anyway i can achieve it?
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 31 Jan 2008 at 3:05pm
Can you insert the "and" yourself by parsing out the string and concatenating it in?
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Posted: 07 Feb 2008 at 2:47pm
I would put it right before the last word in the string. Then test it to see what exceptions cause it not to work and add some if-then statements to account for these exceptions. And I would test the string first to make sure it includes the word "hundred" or "thousand" in it to see if "and" is necessary or not.
Edited by BrianBischof - 07 Feb 2008 at 2:48pm
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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