Apache OpenOffice (AOO) Bugzilla – Issue 43043
RFE: Number and currency spellout
Last modified: 2013-08-07 15:00:01 UTC
Spellout is the textual representation of a number depending on the current locale. There are two forms of spellout. - Number spellout - e.g., in en_US : '42' -> 'forty-two', 1.5 -> 'one point five' - Currency spellout - e.g., in en_US in USD : '25.50' -> 'twenty-five dollars and fifty cents'. For number spellout, the parameter is the locale. For currency spellout, the parameters are the locale and the currency unit (you could say '25.50' in en_US/GBP as twenty-five pounds and fifty pence). In MS Office (tested in Office 2003) there happen to be two features that implement similar functionality. One is BAHTTEXT() function in Excel which implement Thai currency spellout in Baht. The other is DOLLARTEXT field code in Word - http://support.microsoft.com/default.aspx?scid=kb;en-us;173287 Number spellout, especially currency spellout is essential, e.g. for printing checks and receipts. The point is how to implement number spellout and currency spellout in OOo. There are two possibilities :- a) using 'number format' like [natnum4], e.g. In Calc - '10' in a calc cell format with number format '[natnum4]0' in en_US locale would be displayed as 'ten' b) using function like SPELLOUT() (see issue 3702), like the way BAHTTEXT() is implemented in Excel, e.g. in Calc 'SPELLOUT(10, "en_US")' -> 'ten', 'SPELLOUT(10, “en_US”, "USD")' -> 'ten dollars'. Using number format :- To quote Karl Hong in an email conversation > For CJK numbering, (natnum)1 is for digit to digit coversion (lower case), 2 is for digit to digit (upper case), 3 is for double width ASCII numbering, 4 is for spellout (lower case), 5 is for spellout (upper case). Korean has more for hangual numbering. So I think it might be possible to also use the number format '[natnum4]0' (ten) and '[natnum5]0' (TEN) to spellout numbers in various locales other than CJK. Actually, this has been implemented in OpenOfficeTLE (a Thai localized version of OOo 1.1.x) to spellout numbers when the locale is Thai, see issue 17754. For currency spellout, I don't know what should be use. Another form of number format might be invented, e.g. using number format like '[natnum4]0[$USD]' to get 'ten dollars'. The advantage of using number formats is that the users will be able to see and choose the new spellout number formats from the list in Format Cell->Numbers->Format and see the sample. So it is easier to use than using a new function. Using SPELLOUT() function :- See issue 3702. Implementation:- For implementation, OOo could use ICU RuleBasedNumberFormat - http://icu.sourceforge.net/apiref/icu4c/classRuleBasedNumberFormat.html - which currently doesn't seem to support currency but should be easy to extend since it is rule-based.
There's a problem when I post this issue. Issuezilla tell me to go back and submit it again, result in duplicate issue. Please mark one as duplicate. Thanks.
*** Issue 43044 has been marked as a duplicate of this issue. ***
feature proposal. comfirmed.
Fix typo in summary
*** Issue 17754 has been marked as a duplicate of this issue. ***
set target to OOo Later.
FT: I'm leaving so I will re-assign this issue to requirement default user
For Thai, half of this issue - currency spellout - has been implemented in issue 42727 (Interoperatability with Thai MS Excel 97 : BAHTTEXT() and t number format prefix). Now I can use BAHTTEXT() to spellout money in Baht in Excel. (Actually I also want to use it in Writer but can't). The less of the requirement :- - generic currency spellout using single function, for all currency. - generic number spellout using the same function above, or [natnum#] number format like suggested in issue 17754 (Thai native number spellout).