Issue 43043 - RFE: Number and currency spellout
Summary: RFE: Number and currency spellout
Status: CONFIRMED
Alias: None
Product: Internationalization
Classification: Code
Component: code (show other issues)
Version: current
Hardware: All All
: P3 Trivial with 6 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: oooqa
: 17754 43044 (view as issue list)
Depends on:
Blocks: 41707
  Show dependency tree
 
Reported: 2005-02-18 06:00 UTC by samphan
Modified: 2013-08-07 15:00 UTC (History)
6 users (show)

See Also:
Issue Type: FEATURE
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description samphan 2005-02-18 06:00:22 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.
Comment 1 samphan 2005-02-18 06:41:39 UTC
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.
Comment 2 arthit 2005-02-18 22:41:11 UTC
*** Issue 43044 has been marked as a duplicate of this issue. ***
Comment 3 arthit 2005-03-18 10:49:44 UTC
feature proposal.
comfirmed.
Comment 4 jjc 2005-04-22 04:38:07 UTC
Fix typo in summary
Comment 5 jjc 2005-04-22 04:41:30 UTC
*** Issue 17754 has been marked as a duplicate of this issue. ***
Comment 6 Martin Hollmichel 2005-05-22 07:31:33 UTC
set target to OOo Later.
Comment 7 falko.tesch 2005-10-20 20:57:17 UTC
FT: I'm leaving so I will re-assign this issue to requirement default user
Comment 8 samphan 2006-01-26 08:25:44 UTC
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).