Apache OpenOffice (AOO) Bugzilla – Issue 43044
Number and currency spellout
Last modified: 2005-02-18 22:42:20 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.
Duplicate of issue 43043. As reported by the original issue reporter. *** This issue has been marked as a duplicate of 43043 ***
Resolved as duplicate -> Closed.