I passed the number formatting problem on to a friend of mine
who happens to be a linguist as well as a computer hacker.
(there I go again, using a word in an older, this time respectable, meaning)
He replied as follows:
-- hendrik
----- Forwarded message from stephen p spackman -----
>From [EMAIL PROTECTED] Wed Mar 22 15:35:40 2000
Message-ID: <[EMAIL PROTECTED]>
Date: Wed, 22 Mar 2000 15:48:42 -0500
From: stephen p spackman <[EMAIL PROTECTED]>
Organization: pooq.com
X-Mailer: Mozilla 4.7 [en] (Win98; U)
X-Accept-Language: en-GB,en,fr,de
To: Hendrik Boom <[EMAIL PROTECTED]>
Subject: Re: i18n and check printing and Europe (fwd)
References: <[EMAIL PROTECTED]>
[Hendrik: forward to the group if you deem appropriate]
Even in English we have, in many dialects, "five hundreds of dollars" (as opposed to
"five
hundred dollars") not to mention "threescore dollars and twelve". I believe my
grandfather
wrote "Seventy-Five Pounds and 26/100", but "Seventy-Five Pounds Only"; yet "One
Hundred Pounds
Exactly".
French (in France and Quebec) expresses 71 as 60+11 and 91 as 4*20+11, of course. Other
variants of French have words for 70 and 90.
And it is of not to be forgotten that the U.S. "one hundred ten" is "one hundred and
ten" for
the rest of us.
Evidently european languages differ in whether a <milliard> is more or less than a
<million>.
Britain is currently in flux as to whether a billion is a thousand million (following
the U.S.
and the "billionaire's" ego) or a million million (following tradition, logic, and the
rest of
the world). Fortunately the thousand million/million million formulations themselves
are
unambiguous and acceptable. There also seem to be variants of English that use
milliard and
billiard; I don't know where these are spoken, though.
It gets worse: some languages - I think Japanese among them, could be wrong - use
different
number series for counting different things (much as eggs come in dozens and shoes
come in
pairs, but much, much worse), so if you care about more than just dollar values on
cheques
there are. You might need to worry about gender agreements as well.
The moral: you need a methodology before you start making tables. The tables need to be
editable, and they need to take the form of ordered rules with number theoretical
guards on the
left and grammatical productions on the right. Attribute grammars for maths.
In the following, (x ! y) is (x - x % y); ~0 means "nonzero"; $ is the quantity we're
encoding.
An empty lhs matches anything. We use e3 etc. as an abbreviation for 1000.
Sorry for all the _notation_ being ad hoc; I've already spent too long thinking about
the
content :-).
--> one variant of english
eng.UK.centAmount:
0: nothing
~0 % 100: [dollarAmount $ / 100] and [number $ % 100] cents
~0 % e4: [dollarAmount $ / 100] only
: [dollarAmount $ / 100] exactly
eng.UK.dollarAmount:
0: no dollars
1: one dollar
: [number $] dollars
eng.UK.number:
0: zero
1: one
2: two
3: three
4: four
5: five
6: six
7: seven
8: eight
9: nine
10: ten
11: eleven
12: twelve
13: thirteen
15: fifteen
<20: [$ % 10]teen
20: twenty
30: thirty
40: forty
50: fifty
<100 & 0%10: [$/10]ty
<100: [$ ! 10]-[$ % 10]
~0 % 100: [$ ! 100] and [$ % 100]
<e3: [$ / 100] hundred
~0 % e3: [$ ! e3] [$ % e3]
<e6: [$ / e3] thousand
~0 % e6: [$ ! e6] [$ % e6]
: [big(million) $ / e6]
eng.UK.big($1):
< e6: [number $] $1
~0 % e6: [big(million $1) $ / e6] [$ % e6]
: [big(million $1) $ / e6]
--> e.g.
[centAmount 1234567890123456789044]
[dollarAmount 12345678901234567890] and [number 44] cents
[number 12345678901234567890] dollars and [number 40]-[number 4] cents
[number 12345678901234567800] and [number 90] dollars and forty-four cents
[number 12345678901234567000] [number 8] hundred and [number 9]ty dollars...
[number 12345678901234000000] [number 567] thousand eight hundred and ninety ...
[big(million) 12345678901234] [number 500] and [number 67] thousand eight ...
[big(million million) 12345678] [big(million) 901234] [number 5] hundred and [number
60]-[number 7] thousand ...
[big(million million million) 12] [big(million million) 345678] [number 901234]
million five
hundred and [number 6]ty-seven thousand ...
[number 12] million million million [number 345678] million million [number 901200]
and [number
34] million five hundred and sixty-seven thousand ...
twelve million million million [number 345600] and [number 78] million million [number
901000]
[number 200] and [number 30]-[number 4] million five ...
twelve million million million [number 345000] [number 600] and [number 70]-[number 8]
million
million [number 901] thousand [number 2] hundred and thirty-four million five ...
twelve million million million [number 345] thousand [number 6] hundred and [number
7]ty-eight
million million [number 900] and [number 1] thousand two hundred ...
twelve million million million [number 300] and [number 45] thousand six hundred and
seventy-eight million million [number 9] hundred and one thousand ...
twelve million million million [number 3] hundred and [number 40]-[number 5] thousand
six
hundred and seventy-eight million million nine hundred and one thousand ...
twelve million million million three hundred and forty-five thousand six hundred and
seventy-eight million million nine hundred and one thousand two hundred and
thirty-four million
five hundred and sixty-seven thousand eight hundred and ninety dollars and forty-four
cents
--> Stephen's lame attempt at french (this is from memory and may be horribly,
horribly wrong)
fra.FR.number:
0: zero
1: un
2: deux
3: trois
4: quatre
5: cinq
6: six
7: sept
8: huit
9: neuf
10: dix
11: onze
12: douze
13: treize
14: quatorze
15: quinze
16: seize
20: vingt
30: trente
40: quarante
50: cinquante
<60: [$ ! 10]-[$ % 10]
60: soixante
80: quatre-vingt
<100: [$ ! 20]-[$ % 20]
100: cent
~0 % 100: [$ ! 100] [$ % 100]
<e3: [$ / 100] cent
e3: mille
~0 % e3: [$ ! e3] [$ % e3]
<e6: [$ / e3] mille
~0 % e6: [$ ! e6] [$ % e6]
: [big(1) / e6]
fra.FR.big($1):
<e3: [number $] [.bignumPrefix $1]illion
~0 % e3: [$ ! e3] [$ % e3]
<e6: [number $ / e3] [.bignumPrefix $1]illiard
~0 % e6: [$ ! e6] [$ % e6]
: [big([$1 + 1]) $ / e6]
bignumPrefix:
1: m
2: b
3: tr
... ... actually here we use the full grammar for what is it, Latin? ...
[number 12345678901234567890]
[number 12345678901234567800] [number 90]
[number 12345678901234567000] [number 800] [number 80]-[number 10]
[number 12345678901234000000] [number 567000] [number 8] cent quatre-vingt-dix
[big(1) 12345678901234] [number 567] mille huit cent quatre-vingt-dix
[big(1) 12345678901000] [big(1) 234] [number 500] [number 67] mille huit cent ...
[big(1) 12345678000000] [big(1) 901000] [number 234] [prefix 1]illion [number 5] cent
[number
60]-[number 7] mille ...
[big(2) 12345678] [number 901] [prefix 1]illiard [number 200] [number 34] million cinq
cent
soixante-sept mille ...
[big(2) 12345000] [big(2) 678] [number 900] [number 1] milliard [number 2] cent [number
30]-[number 4] million ...
[big(2) 12000000] [big(2) 345000] [number 678] [prefix 2]illion [number 9] cent un
milliard
deux cent trente-quatre million ...
[big(3) 12] [number 345] [prefix 2]illiard [number 600] [number 78] billion neuf cent
un
milliard ...
[number 12] [prefix 3]illion [number 300] [number 45] billiard [number 6] cent [number
60]-[number 18] billion ...
douze trillion [number 3] cent [number 40]-[number 5] billiard six cent
soixante-[number
10]-[number 8] billion ...
douze trillion trois cent quarante-cinq billiard six cent soixante-dix-huit billion
neuf cent
un milliard deux cent trente-quatre million cinq cent soixante-sept mille huit cent
quatre-vingt-dix
Both of the above grammars probably need some commas in them, too.
stephen
----- End of forwarded message from stephen p spackman -----
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]