tocurrencywords to convert amount to words

Stimulsoft Reports.NET discussion
Post Reply
mihiri2
Posts: 43
Joined: Mon Apr 08, 2013 2:29 am

tocurrencywords to convert amount to words

Post by mihiri2 »

Hi,

I am in SS 2014.3 version and would like to know if the following is possible and if so how to achieve it.

example amount = BHD 1234.456

Should be converted to "One thousand two hundred and thirty four & 456/1000 Only"

I did try ToCurrencyWords(1234.456, true, true, "Dinnar/Dinnar","Fills/Fills") and then it gets converted as "ONE THOUSAND TWO HUNDRED AND THIRTY-FOUR DINNAR AND FORTY-FIVE FILLS"

Thanks
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Re: tocurrencywords to convert amount to words

Post by Ivan »

Hello,

Please try to use the following expression:

Code: Select all

{ToWords((int)var) + " & " + Math.Round((var - (int)var) * 1000, 0) + "/1000 Only"}
where var is your value, for example variable or datasource field.

Thank you.
mihiri2
Posts: 43
Joined: Mon Apr 08, 2013 2:29 am

Re: tocurrencywords to convert amount to words

Post by mihiri2 »

Thanks Ivan, it did work.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: tocurrencywords to convert amount to words

Post by Andrew »

Great!

Have a nice day!
Post Reply