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?
Look at this class EnglishNumberToWords that is doing what you want.
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).
精彩评论