Sensa
Sensa

Reputation: 393

Converting number to words in Crystal Reports

How can you convert a number to its written-equivalent in a formula?

For example, 10000 is converted to Ten Thousand.

Upvotes: 10

Views: 50334

Answers (4)

Nithin K
Nithin K

Reputation: 11

numbervar x:= int({numberfield});
numbervar y:= {numberfield}-x);
if(y>0)then
propercase("AED "+ ToWords((x),0)+" and"+ToWords((y*100),0)+" Fils Only")
else
propercase("AED "+ToWords((x),0)+" Only");

Upvotes: 1

bikram s.
bikram s.

Reputation: 327

If you need in proper Indian formats like **Four lakhs Twenty Three Thousand...**etc, then follow the link https://archive.sap.com/discussions/thread/2030967. Refer comment by Balakumar Viswanathan. It worked for me.

Upvotes: 2

sombir Sharma
sombir Sharma

Reputation: 21

//{@Convert}
// returns Ten Thousand
ProperCase( ToWords(20,25000, 0) )

This show two hundred and twenty five thousand only.

Upvotes: 2

craig
craig

Reputation: 26272

You want to use the ToWords() and ProperCase() functions.

//{@Convert}
// returns Ten Thousand
ProperCase( ToWords(10000, 0) )

Upvotes: 22

Related Questions