blong824
blong824

Reputation: 4030

Convert BigDecimal to String for a check

Is there a library or a call that will convert a BigDecimal value to a string to print on checks?

Example: 1323.03

One Thousand Three Hundred Twenty-Three Dollars and Three Cents

I have seen some examples that create a recursive function to do this but I was wondering if it was part of any standard library?

Upvotes: 0

Views: 3056

Answers (2)

anubhava
anubhava

Reputation: 784878

Look at this class EnglishNumberToWords that is doing what you want.

Upvotes: 3

michel-slm
michel-slm

Reputation: 9756

I'm pretty sure it does not exist as part of any standard library. It's just too rarely used and there are so many ways of doing it (e.g. your way only work for conversion into English of currency amount, assuming dollars and cents).

Upvotes: 1

Related Questions