Download
(defgroup spelln-number nil
"Spell out an integer or currency in words"
:link '(emacs-library-link :tag "Source Lisp File" "spell-number.el")
:prefix "spelln-"
:group 'local)
(defcustom spelln-language 'portuguese-br
"*Specify the language to spell out a number in words.
See also `spelln-language-database'."
:type '(radio
:tag "Language"
(const catalan) (const danish) (const dutch)
(const english-eur) (const english-gb) (const english-us)
(const esperanto) (const finnish) (const french-ch)
(const french-fr) (const german) (const italian)
(const japanese) (const norwegian) (const portuguese-br)
(const portuguese-pt) (const spanish) (const swedish))
:group 'spelln-number)
(defcustom spelln-country 'brazil
"*Specify the country to spell out a currency in words.
See also `spelln-country-database'."
:type '(radio
:tag "Country"
(const andorra-french) (const andorra-spanish)
(const antigua-and-barbuda)
(const argentina) (const australia) (const austria)
(const bahamas) (const barbados) (const belgium)
(const belize) (const benin) (const bolivia)
(const brazil) (const brunei)
(const burkina-faso) (const burundi) (const cameroon)
(const canada) (const cape-verde)
(const central-african-republic) (const chad)
(const chile) (const colombia) (const comoros)
(const congo) (const costa-rica) (const cuba)
(const cyprus) (const denmark) (const djibouti)
(const dominica) (const dominican-republic)
(const ecuador) (const el-salvador)
(const equatorial-guinea) (const fiji)
(const finland) (const france) (const gabon)
(const germany) (const grenada) (const guatemala)
(const guinea) (const guinea-bissau) (const guyana)
(const haiti) (const honduras) (const ireland)
(const italy) (const ivory-coast) (const jamaica)
(const japan) (const kenya) (const kiribati)
(const liberia) (const liechtenstein) (const luxembourg)
(const madagascar) (const mali) (const mexico)
(const monaco) (const mozambique) (const namibia)
(const nauru) (const netherlands) (const new-zealand)
(const nicaragua) (const niger) (const norway)
(const panama) (const paraguay) (const peru)
(const philippines) (const portugal) (const rwanda)
(const sao-tome-and-principe) (const senegal)
(const singapore) (const solomon-islands) (const somalia)
(const south-africa) (const spain)
(const st-kitts-and-nevis) (const st-lucia)
(const st-vicent-and-grenadines) (const sweden)
(const switzerland) (const taiwan) (const tanzania)
(const togo) (const trinidad-and-tobago)
(const tuvalu) (const uganda) (const united-kingdom)
(const united-states) (const uruguay)
(const venezuela) (const zimbabwe))
:group 'spelln-number)
(defcustom spelln-zero-cents t
"*Non-nil means that \" and zero cents\" is spelled out.
If cent part is different than zero, it's always spelled out.
It's used in `spelln-currency-in-words' and `spelln-currency-string-in-words'."
:type 'boolean
:group 'spelln-number)
(defcustom spelln-and-p t
"*Non-nil means that and part of `spelln-language-database' is spelled out.
See also `spelln-language-database'.
It's used in `spelln-currency-in-words' and `spelln-currency-string-in-words'."
:type 'boolean
:group 'spelln-number)
(defcustom spelln-comma-p t
"*Non-nil means that comma part of `spelln-language-database' is spelled out.
See also `spelln-language-database'.
It's used in `spelln-currency-in-words' and `spelln-currency-string-in-words'."
:type 'boolean
:group 'spelln-number)
(defcustom spelln-gender-default 'masculine
"*Specify the default gender to be used when there is no neuter gender.
It's used in `spelln-int' and `spelln-str'."
:type '(radio :tag "Gender"
(const feminine) (const masculine))
:group 'spelln-number)
(defcustom spelln-period-character ?.
"*Specify the character to separate periods.
For example, in the numeric string \"1.000,00\" this variable should be set to
character `.'.
It's used in `spelln-currency-string-in-words' and
`spelln-numeric-string-in-words'."
:type 'character
:group 'spelln-number)
(defcustom spelln-decimal-character ?,
"*Specify the decimal point character.
For example, in the numeric string \"1.000,00\" this variable should be set to
character `,'.
It's used in `spelln-currency-string-in-words'."
:type 'character
:group 'spelln-number)
(defvar spelln-zero nil)
(defvar spelln-comma nil)
(defvar spelln-minus nil)
(defvar spelln-and nil)
(defvar spelln-digits-period 3)
(defvar spelln-tens nil)
(defvar spelln-hundreds nil)
(defvar spelln-hundreds-tens nil)
(defvar spelln-singular-period nil)
(defvar spelln-plural-period nil)
(defvar spelln-extra nil)
(defvar spelln-currency-extra nil)
(defvar spelln-gender 1)
(defvar spelln-env-strings nil)
(defvar spelln-env-separator 0)
(defvar spelln-env-period 0)
(defvar spelln-env-gender 2)
(defun spelln-aref-gender (number)
(if (vectorp number)
(or (aref number spelln-env-gender)
(aref number spelln-gender))
number))
(defun spelln-aref-period (vector &optional null-p)
(if (> spelln-env-period 5)
(and (not null-p)
(format " ?10^%d? " (* spelln-digits-period spelln-env-period)))
(aref vector spelln-env-period)))
(defun spelln-aref-gender-period (vector &optional null-p)
(spelln-aref-gender (spelln-aref-period vector null-p)))
(defun spelln-concat (&rest str-list)
(setq spelln-env-strings (concat (apply 'concat str-list)
spelln-env-strings)))
(defun spelln-concat-power (strnum vector)
(let ((power (and (> spelln-env-period 0)
vector (spelln-aref-gender-period vector t)))
(strnum (spelln-aref-gender strnum)))
(if power
(spelln-concat (substring strnum 0 (- (length strnum) (aref vector 0)))
power)
(spelln-concat strnum
(spelln-aref-gender-period spelln-plural-period)))))
(defun spelln-currency-extra (str)
(let ((clist spelln-currency-extra)
extra)
(save-match-data
(while clist
(setq extra (car clist)
clist (cdr clist))
(and (string-match (aref extra 0) str)
(setq str (replace-match (aref extra 1) t nil str))))))
str)
(defun spelln-engine-hundreds (integer &optional period-state)
(setq integer (mod integer 1000)
spelln-env-separator
(cond
((= spelln-env-separator 0)
1)
((= spelln-env-separator 1)
(and spelln-and-p
(spelln-concat (if (vectorp spelln-and)
(and (> integer 0)
(aref spelln-and
(if (> spelln-env-period 1)
1
0)))
spelln-and)))
(if (and (vectorp spelln-and) (<= integer 0))
1
2))
((= spelln-env-separator 2)
(and spelln-comma-p
(spelln-concat spelln-comma))
2)
((= spelln-env-separator 3)
2)))
(cond
((= integer 0)
(and period-state
(spelln-concat (spelln-aref-gender-period (if (= period-state 2)
spelln-plural-period
spelln-singular-period))))
(setq spelln-env-separator (if (= spelln-env-separator 1)
(if (vectorp spelln-and)
1
0)
3)))
((= integer 1)
(spelln-concat (spelln-aref-gender-period (if (and period-state
(= period-state 2))
spelln-plural-period
spelln-singular-period))))
(t
(let ((tens (mod integer 100))
(hundreds (/ integer 100)))
(cond
((null spelln-extra)
(spelln-concat (spelln-aref-gender (aref spelln-tens tens))
(spelln-aref-gender-period spelln-plural-period))
(and (> hundreds 0)
(spelln-concat (spelln-aref-gender
(aref (if (zerop tens)
spelln-hundreds
(setq spelln-env-separator 2)
spelln-hundreds-tens)
hundreds)))))
((zerop tens)
(spelln-concat-power (aref spelln-hundreds hundreds)
(aref spelln-extra 2)))
(t
(setq spelln-env-separator 2)
(spelln-concat-power (aref spelln-tens tens)
(let ((units (mod tens 10)))
(if (zerop units)
(aref spelln-extra 1)
(aref (aref spelln-extra 0) units))))
(and (> hundreds 0)
(spelln-concat
(spelln-aref-gender (aref spelln-hundreds-tens hundreds)))))))))
(setq spelln-env-period (1+ spelln-env-period)))
(defun spelln-engine (integer)
(spelln-engine-hundreds integer
(cond ((= integer 0) nil)
((= integer 1) 1)
(t 2)))
(and (> spelln-digits-period 3)
(= spelln-env-period 1)
(setq spelln-env-period 2))
(and (> (setq integer (/ integer 1000)) 0)
(let ((spelln-env-period 1))
(spelln-engine-hundreds integer))))
(defconst spelln-gender-alist
'((feminine . 0)
(masculine . 1)
(neuter . 2))
"Alist for gender index used by `spelln-int' and `spelln-str'.")
(defun spelln-env-init (gender-sym)
(setq spelln-env-strings nil
spelln-env-period 0
spelln-env-separator 0
spelln-env-gender
(or (cdr (assoc gender-sym spelln-gender-alist))
2)))
(defun spelln-int (int gender-sym)
(let ((negative (< int 0))
(integer (abs int))
(power (expt 10 spelln-digits-period))
rest rest-tens rest-units tens units)
(if (or (null spelln-tens) (zerop integer))
spelln-zero
(spelln-env-init gender-sym)
(setq spelln-gender (or (cdr (assoc spelln-gender-default
spelln-gender-alist))
1))
(while (> integer 0)
(setq rest (mod integer power))
(spelln-engine rest)
(setq integer (/ integer power)))
(spelln-sign-and-trim-spaces negative))))
(defun spelln-str (str gender-sym &optional places)
(let ((len (length str))
(power10 [1 10 100 1000 10000 100000 1000000])
(number 0)
negative start stri integer power)
(if (or (null spelln-tens) (zerop len))
nil
(setq spelln-gender (or (cdr (assoc spelln-gender-default
spelln-gender-alist))
1)
start (cond ((= (aref str 0) ?+) 1)
((= (aref str 0) ?-) (setq negative t) 1)
(t 0)
))
(or places
(while (and (< start len)
(or (= (aref str start) ?0)
(= (aref str start) spelln-period-character)))
(setq start (1+ start))))
(if (= start len)
(cons 0 spelln-zero)
(spelln-env-init gender-sym)
(if (not places)
(setq stri (1- len)
power 1)
(setq stri start)
(while (and (> places 0) (< stri len))
(while (and (< stri len)
(= (aref str stri) spelln-period-character))
(setq stri (1+ stri)))
(setq stri (1+ stri)
places (1- places)))
(setq stri (1- stri)
power (aref power10 places)))
(while (>= stri start)
(let ((i 0))
(setq integer 0)
(while (and (>= stri start) (< i spelln-digits-period))
(while (and (>= stri start)
(= (aref str stri) spelln-period-character))
(setq stri (1- stri)))
(and (>= stri start)
(setq integer (+ (* (aref power10 i)
(- (aref str stri) ?0))
integer)))
(setq i (1+ i)
stri (1- stri))))
(setq integer (* integer power))
(spelln-engine integer))
(cons (cond ((> spelln-env-period 1) 2)
((= integer 0) 0)
((= integer 1) 1)
(t 2))
(spelln-sign-and-trim-spaces negative))))))
(defun spelln-sign-and-trim-spaces (negative)
(if (or (null spelln-env-strings) (string= spelln-env-strings ""))
spelln-zero
(and negative
(setq spelln-env-strings (concat spelln-minus spelln-env-strings)))
(let ((from 0)
(to (1- (length spelln-env-strings))))
(while (= (aref spelln-env-strings from) ?\ )
(setq from (1+ from)))
(while (= (aref spelln-env-strings to) ?\ )
(setq to (1- to)))
(substring spelln-env-strings from (1+ to)))))
(defconst spelln-language-database
'(
(catalan
"zero"
""
"menos"
" i"
6
[""
[" una" " un" nil] [" dues" " dos" nil] " tres"
" quatre" " cinc" " sis"
" set" " vuit" " nou"
" deu"
" onze" " dotze" " tretze"
" catorze" " quinze" " setze"
" disset" " divuit" " dinou"
" vint"
[" vint-i-una" " vint-i-un" nil]
[" vint-i-dues" " vint-i-dos" nil] " vint-i-tres"
" vint-i-quatre" " vint-i-cinc" " vint-i-sis"
" vint-i-set" " vint-i-vuit" " vint-i-nou"
" trenta"
[" trenta-i-una" " trenta-i-un" nil]
[" trenta-i-dues" " trenta-i-dos" nil] " trenta-i-tres"
" trenta-i-cuatro" " trenta-i-cinco" " trenta-i-seis"
" trenta-i-siete" " trenta-i-ocho" " trenta-i-nueve"
" quarenta"
[" quarenta-i-una" " quarenta-i-un" nil]
[" quarenta-i-dues" " quarenta-i-dos" nil] " quarenta-i-tres"
" quarenta-i-cuatro" " quarenta-i-cinco" " quarenta-i-seis"
" quarenta-i-siete" " quarenta-i-ocho" " quarenta-i-nueve"
" cinquanta"
[" cinqanta-i-una" " cinqanta-i-un" nil]
[" cinqanta-i-dues" " cinqanta-i-dos" nil] " cinqanta-i-tres"
" cinqanta-i-cuatro" " cinqanta-i-cinco" " cinqanta-i-seis"
" cinqanta-i-siete" " cinqanta-i-ocho" " cinqanta-i-nueve"
" seixanta"
[" seixanta-i-una" " seixanta-i-un" nil]
[" seixanta-i-dues" " seixanta-i-dos" nil] " seixanta-i-tres"
" seixanta-i-cuatro" " seixanta-i-cinco" " seixanta-i-seis"
" seixanta-i-siete" " seixanta-i-ocho" " seixanta-i-nueve"
" setanta"
[" setanta-i-una" " setanta-i-un" nil]
[" setanta-i-dues" " setanta-i-dos" nil] " setanta-i-tres"
" setanta-i-cuatro" " setanta-i-cinco" " setanta-i-seis"
" setanta-i-siete" " setanta-i-ocho" " setanta-i-nueve"
" vuitanta"
[" vuitanta-i-una" " vuitanta-i-un" nil]
[" vuitanta-i-dues" " vuitanta-i-dos" nil] " vuitanta-i-tres"
" vuitanta-i-cuatro" " vuitanta-i-cinco" " vuitanta-i-seis"
" vuitanta-i-siete" " vuitanta-i-ocho" " vuitanta-i-nueve"
" noranta"
[" noranta-i-una" " noranta-i-un" nil]
[" noranta-i-dues" " noranta-i-dos" nil] " noranta-i-tres"
" noranta-i-cuatro" " noranta-i-cinco" " noranta-i-seis"
" noranta-i-siete" " noranta-i-ocho" " noranta-i-nueve"]
[""
" cent"
" doscent"
" trescent"
" quatrecent"
" cinccent"
" siscent"
" setcent"
" vuitcent"
" noucent"]
[""
" cent"
" doscent"
" trescent"
" quatrecent"
" cinccent"
" siscent"
" setcent"
" vuitcent"
" noucent"]
[[" una" " un" nil]
" mil"
" un millón"
" un billón"
" un trillón"
" un quatrillón"]
[""
" mil"
" millones"
" billones"
" trillones"
" quatrillones"]
)
(danish
"nul"
","
"minus"
" og"
3
[""
" en" " to" " tre"
" fire" " fem" " seks"
" syv" " otte" " ni"
" ti"
" elleve" " tolv" " tretten"
" fjorten" " femten" " seksten"
" sytten" " atten" " nitten"
" tyve"
" en og tyve" " to og tyve" " tre og tyve"
" fire og tyve" " fem og tyve" " seks og tyve"
" syv og tyve" " otte og tyve" " ni og tyve"
" tredive"
" en og tredive" " to og tredive" " tre og tredive"
" fire og tredive" " fem og tredive" " seks og tredive"
" syv og tredive" " otte og tredive" " ni og tredive"
" fyrre"
" en og fyrre" " to og fyrre" " tre og fyrre"
" fire og fyrre" " fem og fyrre" " seks og fyrre"
" syv og fyrre" " otte og fyrre" " ni og fyrre"
" halvtreds"
" en og halvtreds" " to og halvtreds" " tre og halvtreds"
" fire og halvtreds" " fem og halvtreds" " seks og halvtreds"
" syv og halvtreds" " otte og halvtreds" " ni og halvtreds"
" tres"
" en og tres" " to og tres" " tre og tres"
" fire og tres" " fem og tres" " seks og tres"
" syv og tres" " otte og tres" " ni og tres"
" halvfjerds"
" en og halvfjerds" " to og halvfjerds" " tre og halvfjerds"
" fire og halvfjerds" " fem og halvfjerds" " seks og halvfjerds"
" syv og halvfjerds" " otte og halvfjerds" " ni og halvfjerds"
" firs"
" en og firs" " to og firs" " tre og firs"
" fire og firs" " fem og firs" " seks og firs"
" syv og firs" " otte og firs" " ni og firs"
" halvfems"
" en og halvfems" " to og halvfems" " tre og halvfems"
" fire og halvfems" " fem og halvfems" " seks og halvfems"
" syv og halvfems" " otte og halvfems" " ni og halvfems"]
[""
" et hundred"
" to hundred"
" tre hundred"
" fire hundred"
" fem hundred"
" seks hundred"
" syv hundred"
" otte hundred"
" ni hundred"]
[""
" et hundred og"
" to hundred og"
" tre hundred og"
" fire hundred og"
" fem hundred og"
" seks hundred og"
" syv hundred og"
" otte hundred og"
" ni hundred og"]
[" en"
" en tusind"
" en million"
" en milliard"
" en billion"
" en billiard"]
[""
" tusind"
" millioner"
" milliarder"
" billioner"
" billiarder"]
)
(dutch
"nul"
""
"minus "
"en"
3
[""
["eene" "een" nil] "twee" "drie"
"vier" "vijf" "zes"
"zeven" "acht" "negen"
"tien"
"elf" "twaalf" "dertien"
"veertien" "vijftien" "zestien"
"zeventien" "achttien" "negentien"
"twintig"
"eenentwintig" "tweeentwintig" "drieentwintig"
"vierentwintig" "vijfentwintig" "zesentwintig"
"zevenentwintig" "achtentwintig" "negenentwintig"
"dertig"
"eenendertig" "tweeendertig" "drieendertig"
"vierendertig" "vijfendertig" "zesendertig"
"zevenendertig" "achtendertig" "negenendertig"
"veertig"
"eenenveertig" "tweeenveertig" "drieenveertig"
"vierenveertig" "vijfenveertig" "zesenveertig"
"zevenenveertig" "achtenveertig" "negenenveertig"
"vijftig"
"eenenvijftig" "tweeenvijftig" "drieenvijftig"
"vierenvijftig" "vijfenvijftig" "zesenvijftig"
"zevenenvijftig" "achtenvijftig" "negenenvijftig"
"zestig"
"eenenzestig" "tweeenzestig" "drieenzestig"
"vierenzestig" "vijfenzestig" "zesenzestig"
"zevenenzestig" "achtenzestig" "negenenzestig"
"zeventig"
"eenenzeventig" "tweeenzeventig" "drieenzeventig"
"vierenzeventig" "vijfenzeventig" "zesenzeventig"
"zevenenzeventig" "achtenzeventig" "negenenzeventig"
"tachtig"
"eenentachtig" "tweeentachtig" "drieentachtig"
"vierentachtig" "vijfentachtig" "zesentachtig"
"zevenentachtig" "achtentachtig" "negenentachtig"
"negentig"
"eenennegentig" "tweeennegentig" "drieennegentig"
"vierennegentig" "vijfennegentig" "zesennegentig"
"zevenennegentig" "achtennegentig" "negenennegentig"]
[""
"eenhonderd"
"tweehonderd"
"driehonderd"
"vierhonderd"
"vijfhonderd"
"zeshonderd"
"zevenhonderd"
"achthonderd"
"negenhonderd"]
[""
"eenhonderd"
"tweehonderd"
"driehonderd"
"vierhonderd"
"vijfhonderd"
"zeshonderd"
"zevenhonderd"
"achthonderd"
"negenhonderd"]
[["eene" "een" nil]
"eenduizend"
"een miljoen "
"een ?? "
"een ?? "
"een ?? "]
[""
"duizend"
" miljoen "
" ?? "
" ?? "
" ?? "]
)
(english-eur
"zero"
","
"minus"
" and"
6
[""
" one" " two" " three"
" four" " five" " six"
" seven" " eight" " nine"
" ten"
" eleven" " twelve" " thirteen"
" fourteen" " fifteen" " sixteen"
" seventeen" " eighteen" " nineteen"
" twenty"
" twenty one" " twenty two" " twenty three"
" twenty four" " twenty five" " twenty six"
" twenty seven" " twenty eight" " twenty nine"
" thirty"
" thirty one" " thirty two" " thirty three"
" thirty four" " thirty five" " thirty six"
" thirty seven" " thirty eight" " thirty nine"
" fourty"
" fourty one" " fourty two" " fourty three"
" fourty four" " fourty five" " fourty six"
" fourty seven" " fourty eight" " fourty nine"
" fifty"
" fifty one" " fifty two" " fifty three"
" fifty four" " fifty five" " fifty six"
" fifty seven" " fifty eight" " fifty nine"
" sixty"
" sixty one" " sixty two" " sixty three"
" sixty four" " sixty five" " sixty six"
" sixty seven" " sixty eight" " sixty nine"
" seventy"
" seventy one" " seventy two" " seventy three"
" seventy four" " seventy five" " seventy six"
" seventy seven" " seventy eight" " seventy nine"
" eighty"
" eighty one" " eighty two" " eighty three"
" eighty four" " eighty five" " eighty six"
" eighty seven" " eighty eight" " eighty nine"
" ninety"
" ninety one" " ninety two" " ninety three"
" ninety four" " ninety five" " ninety six"
" ninety seven" " ninety eight" " ninety nine"]
[""
" one hundred"
" two hundred"
" three hundred"
" four hundred"
" five hundred"
" six hundred"
" seven hundred"
" eight hundred"
" nine hundred"]
[""
" one hundred"
" two hundred"
" three hundred"
" four hundred"
" five hundred"
" six hundred"
" seven hundred"
" eight hundred"
" nine hundred"]
[" one"
" one thousand"
" one million"
" one billion"
" one trillion"
" one quatrillion"]
[""
" thousand"
" million"
" billion"
" trillion"
" quatrillion"]
)
(english-gb
"zero"
","
"minus"
" and"
3
[""
" one" " two" " three"
" four" " five" " six"
" seven" " eight" " nine"
" ten"
" eleven" " twelve" " thirteen"
" fourteen" " fifteen" " sixteen"
" seventeen" " eighteen" " nineteen"
" twenty"
" twenty one" " twenty two" " twenty three"
" twenty four" " twenty five" " twenty six"
" twenty seven" " twenty eight" " twenty nine"
" thirty"
" thirty one" " thirty two" " thirty three"
" thirty four" " thirty five" " thirty six"
" thirty seven" " thirty eight" " thirty nine"
" fourty"
" fourty one" " fourty two" " fourty three"
" fourty four" " fourty five" " fourty six"
" fourty seven" " fourty eight" " fourty nine"
" fifty"
" fifty one" " fifty two" " fifty three"
" fifty four" " fifty five" " fifty six"
" fifty seven" " fifty eight" " fifty nine"
" sixty"
" sixty one" " sixty two" " sixty three"
" sixty four" " sixty five" " sixty six"
" sixty seven" " sixty eight" " sixty nine"
" seventy"
" seventy one" " seventy two" " seventy three"
" seventy four" " seventy five" " seventy six"
" seventy seven" " seventy eight" " seventy nine"
" eighty"
" eighty one" " eighty two" " eighty three"
" eighty four" " eighty five" " eighty six"
" eighty seven" " eighty eight" " eighty nine"
" ninety"
" ninety one" " ninety two" " ninety three"
" ninety four" " ninety five" " ninety six"
" ninety seven" " ninety eight" " ninety nine"]
[""
" one hundred"
" two hundred"
" three hundred"
" four hundred"
" five hundred"
" six hundred"
" seven hundred"
" eight hundred"
" nine hundred"]
[""
" one hundred and"
" two hundred and"
" three hundred and"
" four hundred and"
" five hundred and"
" six hundred and"
" seven hundred and"
" eight hundred and"
" nine hundred and"]
[" one"
" one thousand"
" one million"
" one milliard"
" one billion"
" one billiard"]
[""
" thousand"
" million"
" milliard"
" billion"
" billiard"]
)
(english-us
"zero"
","
"minus"
" and"
3
[""
" one" " two" " three"
" four" " five" " six"
" seven" " eight" " nine"
" ten"
" eleven" " twelve" " thirteen"
" fourteen" " fifteen" " sixteen"
" seventeen" " eighteen" " nineteen"
" twenty"
" twenty-one" " twenty-two" " twenty-three"
" twenty-four" " twenty-five" " twenty-six"
" twenty-seven" " twenty-eight" " twenty-nine"
" thirty"
" thirty-one" " thirty-two" " thirty-three"
" thirty-four" " thirty-five" " thirty-six"
" thirty-seven" " thirty-eight" " thirty-nine"
" fourty"
" fourty-one" " fourty-two" " fourty-three"
" fourty-four" " fourty-five" " fourty-six"
" fourty-seven" " fourty-eight" " fourty-nine"
" fifty"
" fifty-one" " fifty-two" " fifty-three"
" fifty-four" " fifty-five" " fifty-six"
" fifty-seven" " fifty-eight" " fifty-nine"
" sixty"
" sixty-one" " sixty-two" " sixty-three"
" sixty-four" " sixty-five" " sixty-six"
" sixty-seven" " sixty-eight" " sixty-nine"
" seventy"
" seventy-one" " seventy-two" " seventy-three"
" seventy-four" " seventy-five" " seventy-six"
" seventy-seven" " seventy-eight" " seventy-nine"
" eighty"
" eighty-one" " eighty-two" " eighty-three"
" eighty-four" " eighty-five" " eighty-six"
" eighty-seven" " eighty-eight" " eighty-nine"
" ninety"
" ninety-one" " ninety-two" " ninety-three"
" ninety-four" " ninety-five" " ninety-six"
" ninety-seven" " ninety-eight" " ninety-nine"]
[""
" one hundred"
" two hundred"
" three hundred"
" four hundred"
" five hundred"
" six hundred"
" seven hundred"
" eight hundred"
" nine hundred"]
[""
" one hundred"
" two hundred"
" three hundred"
" four hundred"
" five hundred"
" six hundred"
" seven hundred"
" eight hundred"
" nine hundred"]
[" one"
" one thousand"
" one million"
" one billion"
" one trillion"
" one quatrillion"]
[""
" thousand"
" million"
" billion"
" trillion"
" quatrillion"]
)
(esperanto
"nulo"
","
"minus"
""
3
[""
" unu" " du" " tri"
" kvar" " kvin" " ses"
" sep" " ok" " naü"
" dek"
" dek unu" " dek du" " dek tri"
" dek kvar" " dek kvin" " dek ses"
" dek sep" " dek ok" " dek naü"
" dudek"
" dudek unu" " dudek du" " dudek tri"
" dudek kvar" " dudek kvin" " dudek ses"
" dudek sep" " dudek ok" " dudek naü"
" tridek"
" tridek unu" " tridek du" " tridek tri"
" tridek kvar" " tridek kvin" " tridek ses"
" tridek sep" " tridek ok" " tridek naü"
" kvardek"
" kvardek unu" " kvardek du" " kvardek tri"
" kvardek kvar" " kvardek kvin" " kvardek ses"
" kvardek sep" " kvardek ok" " kvardek naü"
" kvindek"
" kvindek unu" " kvindek du" " kvindek tri"
" kvindek kvar" " kvindek kvin" " kvindek ses"
" kvindek sep" " kvindek ok" " kvindek naü"
" sesdek"
" sesdek unu" " sesdek du" " sesdek tri"
" sesdek kvar" " sesdek kvin" " sesdek ses"
" sesdek sep" " sesdek ok" " sesdek naü"
" sepdek"
" sepdek unu" " sepdek du" " sepdek tri"
" sepdek kvar" " sepdek kvin" " sepdek ses"
" sepdek sep" " sepdek ok" " sepdek naü"
" okdek"
" okdek unu" " okdek du" " okdek tri"
" okdek kvar" " okdek kvin" " okdek ses"
" okdek sep" " okdek ok" " okdek naü"
" naüdek"
" naüdek unu" " naüdek du" " naüdek tri"
" naüdek kvar" " naüdek kvin" " naüdek ses"
" naüdek sep" " naüdek ok" " naüdek naü"]
[""
" cent"
" ducent"
" tricent"
" kvarcent"
" kvincent"
" sescent"
" sepcent"
" okcent"
" naücent"]
[""
" cent"
" ducent"
" tricent"
" kvarcent"
" kvincent"
" sescent"
" sepcent"
" okcent"
" naücent"]
[" unu"
" mil"
" miliono"
" miliardo"
" duiliono"
" duiliardo"]
[""
" mil"
" milionoj"
" miliardoj"
" duilionoj"
" duiliardoj"]
)
(finnish
"nolla"
""
" miinus "
""
3
[""
"yksi" "kaksi" "kolme"
"neljä" "viisi" "kuusi"
"seitsemän" "kahdeksan" "yhdeksän"
"kymmenen"
"yksitoista" "kaksitoista" "kolmetoista"
"neljätoista" "viisitoista" "kuusitoista"
"seitsemäntoista" "kahdeksantoista" "yhdeksäntoista"
"kaksikymmentä"
"kaksikymmentäyksi" "kaksikymmentäkaksi" "kaksikymmentäkolme"
"kaksikymmentäneljä" "kaksikymmentäviisi" "kaksikymmentäkuusi"
"kaksikymmentäseitsemän" "kaksikymmentäkahdeksan"
"kaksikymmentäyhdeksän"
"kolmekymmentä"
"kolmekymmentäyksi" "kolmekymmentäkaksi" "kolmekymmentäkolme"
"kolmekymmentäneljä" "kolmekymmentäviisi" "kolmekymmentäkuusi"
"kolmekymmentäseitsemän" "kolmekymmentäkahdeksan"
"kolmekymmentäyhdeksän"
"neljäkymmentä"
"neljäkymmentäyksi" "neljäkymmentäkaksi" "neljäkymmentäkolme"
"neljäkymmentäneljä" "neljäkymmentäviisi" "neljäkymmentäkuusi"
"neljäkymmentäseitsemän" "neljäkymmentäkahdeksan"
"neljäkymmentäyhdeksän"
"viisikymmentä"
"viisikymmentäyksi" "viisikymmentäkaksi" "viisikymmentäkolme"
"viisikymmentäneljä" "viisikymmentäviisi" "viisikymmentäkuusi"
"viisikymmentäseitsemän" "viisikymmentäkahdeksan"
"viisikymmentäyhdeksän"
"kuusikymmentä"
"kuusikymmentäyksi" "kuusikymmentäkaksi" "kuusikymmentäkolme"
"kuusikymmentäneljä" "kuusikymmentäviisi" "kuusikymmentäkuusi"
"kuusikymmentäseitsemän" "kuusikymmentäkahdeksan"
"kuusikymmentäyhdeksän"
"seitsemänkymmentä"
"seitsemänkymmentäyksi" "seitsemänkymmentäkaksi"
"seitsemänkymmentäkolme"
"seitsemänkymmentäneljä" "seitsemänkymmentäviisi"
"seitsemänkymmentäkuusi"
"seitsemänkymmentäseitsemän" "seitsemänkymmentäkahdeksan"
"seitsemänkymmentäyhdeksän"
"kahdeksankymmentä"
"kahdeksankymmentäyksi" "kahdeksankymmentäkaksi"
"kahdeksankymmentäkolme"
"kahdeksankymmentäneljä" "kahdeksankymmentäviisi"
"kahdeksankymmentäkuusi"
"kahdeksankymmentäseitsemän" "kahdeksankymmentäkahdeksan"
"kahdeksankymmentäyhdeksän"
"yhdeksänkymmentä"
"yhdeksänkymmentäyksi" "yhdeksänkymmentäkaksi" "yhdeksänkymmentäkolme"
"yhdeksänkymmentäneljä" "yhdeksänkymmentäviisi" "yhdeksänkymmentäkuusi"
"yhdeksänkymmentäseitsemän" "yhdeksänkymmentäkahdeksan"
"yhdeksänkymmentäyhdeksän"]
[""
"sata"
"kaksisataa"
"kolmesataa"
"neljäsataa"
"viisisataa"
"kuusisataa"
"seitsemänsataa"
"kahdeksansataa"
"yhdeksänsataa"]
[""
"sata"
"kaksisataa"
"kolmesataa"
"neljäsataa"
"viisisataa"
"kuusisataa"
"seitsemänsataa"
"kahdeksansataa"
"yhdeksänsataa"]
["yksi"
"tuhat"
"miljoona"
"??"
"??"
"??"]
[""
"tuhatta"
"miljoonaa"
"??"
"??"
"??"]
)
(french-ch
"zéro"
","
"moins"
""
3
[""
" un" " deux" " trois"
" quatre" " cinq" " six"
" sept" " huit" " neuf"
" dix"
" onze" " douze" " treize"
" quatorze" " quinze" " seize"
" dix-sept" " dix-huit" " dix-neuf"
" vingt"
" vingt et un" " vingt-deux" " vingt-trois"
" vingt-quatre" " vingt-cinq" " vingt-six"
" vingt-sept" " vingt-huit" " vingt-neuf"
" trente"
" trente et un" " trente-deux" " trente-trois"
" trente-quatre" " trente-cinq" " trente-six"
" trente-sept" " trente-huit" " trente-neuf"
" quarante"
" quarante et un" " quarante-deux" " quarante-trois"
" quarante-quatre" " quarante-cinq" " quarante-six"
" quarante-sept" " quarante-huit" " quarante-neuf"
" cinquente"
" cinquante et un" " cinquante-deux" " cinquante-trois"
" cinquante-quatre" " cinquante-cinq" " cinquante-six"
" cinquante-sept" " cinquante-huit" " cinquante-neuf"
" soixante"
" soixante et un" " soixante-deux" " soixante-trois"
" soixante-quatre" " soixante-cinq" " soixante-six"
" soixante-sept" " soixante-huit" " soixante-neuf"
" septante"
" septante et un" " septante-deux" " septante-trois"
" septante-quatre" " septante-cinq" " septante-six"
" septante-sept" " septante-huit" " septante-neuf"
" octante"
" octante et un" " octante-deux" " octante-trois"
" octante-quatre" " octante-cinq" " octante-six"
" octante-sept" " octante-huit" " octante-neuf"
" nonante"
" nonante et un" " nonante-deux" " nonante-trois"
" nonante-quatre" " nonante-cinq" " nonante-six"
" nonante-sept" " nonante-huit" " nonante-neuf"]
[""
" cent"
" deux cents"
" trois cents"
" quatre cents"
" cinq cents"
" six cents"
" sept cents"
" huit cents"
" neuf cents"]
[""
" cent"
" deux cent"
" trois cent"
" quatre cent"
" cinq cent"
" six cent"
" sept cent"
" huit cent"
" neuf cent"]
[" un"
" mille"
" un million"
" un milliard"
" un billion"
" un billiard"]
[""
" mille"
" millions"
" milliards"
" billions"
" billiards"]
)
(french-fr
"zéro"
","
"moins"
""
3
[""
" un" " deux" " trois"
" quatre" " cinq" " six"
" sept" " huit" " neuf"
" dix"
" onze" " douze" " treize"
" quatorze" " quinze" " seize"
" dix-sept" " dix-huit" " dix-neuf"
" vingt"
" vingt et un" " vingt-deux" " vingt-trois"
" vingt-quatre" " vingt-cinq" " vingt-six"
" vingt-sept" " vingt-huit" " vingt-neuf"
" trente"
" trente et un" " trente-deux" " trente-trois"
" trente-quatre" " trente-cinq" " trente-six"
" trente-sept" " trente-huit" " trente-neuf"
" quarante"
" quarante et un" " quarante-deux" " quarante-trois"
" quarante-quatre" " quarante-cinq" " quarante-six"
" quarante-sept" " quarante-huit" " quarante-neuf"
" cinquente"
" cinquante et un" " cinquante-deux" " cinquante-trois"
" cinquante-quatre" " cinquante-cinq" " cinquante-six"
" cinquante-sept" " cinquante-huit" " cinquante-neuf"
" soixante"
" soixante et un" " soixante-deux" " soixante-trois"
" soixante-quatre" " soixante-cinq" " soixante-six"
" soixante-sept" " soixante-huit" " soixante-neuf"
" soixante-dix"
" soixante et onze" " soixante-douze" " soixante-treize"
" soixante-quatorze" " soixante-quinze" " soixante-seize"
" soixante-dix-sept" " soixante-dix-huit" " soixante-dix-neuf"
" quatre-vingts"
" quatre-vingt-un" " quatre-vingt-deux" " quatre-vingt-trois"
" quatre-vingt-quatre" " quatre-vingt-cinq" " quatre-vingt-six"
" quatre-vingt-sept" " quatre-vingt-huit" " quatre-vingt-neuf"
" quatre-vingt-dix"
" quatre-vingt-onze" " quatre-vingt-douze" " quatre-vingt-treize"
" quatre-vingt-quatorze" " quatre-vingt-quinze" " quatre-vingt-seize"
" quatre-vingt-dix-sept" " quatre-vingt-dix-huit"
" quatre-vingt-dix-neuf"]
[""
" cent"
" deux cents"
" trois cents"
" quatre cents"
" cinq cents"
" six cents"
" sept cents"
" huit cents"
" neuf cents"]
[""
" cent"
" deux cent"
" trois cent"
" quatre cent"
" cinq cent"
" six cent"
" sept cent"
" huit cent"
" neuf cent"]
[" un"
" mille"
" un million"
" un milliard"
" un billion"
" un billiard"]
[""
" mille"
" millions"
" milliards"
" billions"
" billiards"]
)
(german
"null"
""
"minus "
["und" "und "]
3
[""
["eine" "ein" "eins"] "zwei" "drei"
"vier" "fünf" "sechs"
"sieben" "acht" "neun"
"zehn"
"elf" "zwölf" "dreizehn"
"vierzehn" "fünfzehn" "sechzehn"
"siebzehn" "achtzehn" "neunzehn"
"zwanzig"
"einundzwanzig" "zweiundzwanzig" "dreiundzwanzig"
"vierundzwanzig" "fünfundzwanzig" "sechsundzwanzig"
"siebenundzwanzig" "achtundzwanzig" "neunundzwanzig"
"dreissig"
"einunddreissig" "zweiunddreissig" "dreiunddreissig"
"vierunddreissig" "fünfunddreissig" "sechsunddreissig"
"siebenunddreissig" "achtunddreissig" "neununddreissig"
"vierzig"
"einundvierzig" "zweiundvierzig" "dreiundvierzig"
"vierundvierzig" "fünfundvierzig" "sechsundvierzig"
"siebenundvierzig" "achtundvierzig" "neunundvierzig"
"fünfzig"
"einundfünfzig" "zweiundfünfzig" "dreiundfünfzig"
"vierundfünfzig" "fünfundfünfzig" "sechsundfünfzig"
"siebenundfünfzig" "achtundfünfzig" "neunundfünfzig"
"sechzig"
"einundsechzig" "zweiundsechzig" "dreiundsechzig"
"vierundsechzig" "fünfundsechzig" "sechsundsechzig"
"siebenundsechzig" "achtundsechzig" "neunundsechzig"
"siebzig"
"einundsiebzig" "zweiundsiebzig" "dreiundsiebzig"
"vierundsiebzig" "fünfundsiebzig" "sechsundsiebzig"
"siebenundsiebzig" "achtundsiebzig" "neunundsiebzig"
"achtzig"
"einundachtzig" "zweiundachtzig" "dreiundachtzig"
"vierundachtzig" "fünfundachtzig" "sechsundachtzig"
"siebenundachtzig" "achtundachtzig" "neunundachtzig"
"neunzig"
"einundneunzig" "zweiundneunzig" "dreiundneunzig"
"vierundneunzig" "fünfundneunzig" "sechsundneunzig"
"siebenundneunzig" "achtundneunzig" "neunundneunzig"]
[""
"einhundert"
"zweihundert"
"dreihundert"
"vierhundert"
"fünfhundert"
"sechshundert"
"siebenhundert"
"achthundert"
"neunhundert"]
[""
"einhundertund"
"zweihundertund"
"dreihundertund"
"vierhundertund"
"fünfhundertund"
"sechshundertund"
"siebenhundertund"
"achthundertund"
"neunhundertund"]
[["eine" "ein" "eins"]
"eintausend"
"eine Million "
"eine Milliarde "
"eine Billion "
"eine Billiarde "]
[""
"tausend"
" Millionen "
" Milliarden "
" Billionen "
" Billiarden "]
)
(italian
"zero"
""
"meno "
""
3
[""
"uno" "due" "tre"
"quattro" "cinque" "sei"
"sette" "otto" "nove"
"diece"
"undici" "dodici" "tredici"
"quattordici" "quindici" "sedici"
"diciasette" "diciotto" "dicianove"
"venti"
"ventuno" "ventidue" "ventitre"
"ventiquattro" "venticinque" "ventisei"
"ventisette" "ventotto" "ventinove"
"trenta"
"trentuno" "trentadue" "trentatre"
"trentaquattro" "trentacinque" "trentasei"
"trentasette" "trentotto" "trentanove"
"quaranta"
"quarantuno" "quarantadue" "quarantatre"
"quarantaquattro" "quarantacinque" "quarantasei"
"quarantasette" "quarantotto" "quarantanove"
"cinquanta"
"cinquantuno" "cinquantadue" "cinquantatre"
"cinquantaquattro" "cinquantacinque" "cinquantasei"
"cinquantasette" "cinquantotto" "cinquantanove"
"sessanta"
"sessantuno" "sessantadue" "sessantatre"
"sessantaquattro" "sessantacinque" "sessantasei"
"sessantasette" "sessantotto" "sessantanove"
"settanta"
"settantuno" "settantadue" "settantatre"
"settantaquattro" "settantacinque" "settantasei"
"settantasette" "settantotto" "settantanove"
"ottanta"
"ottantuno" "ottantadue" "ottantatre"
"ottantaquattro" "ottantacinque" "ottantasei"
"ottantasette" "ottantotto" "ottantanove"
"novanta"
"novantuno" "novantadue" "novantatre"
"novantaquattro" "novantacinque" "novantasei"
"novantasette" "novantotto" "novantanove"]
[""
"cento"
"duecento"
"trecento"
"quattrocento"
"cinquecento"
"seicento"
"settecento"
"ottocento"
"novecento"]
[""
"cento"
"duecento"
"trecento"
"quattrocento"
"cinquecento"
"seicento"
"settecento"
"ottocento"
"novecento"]
["uno"
"mille"
"un milione "
"un miliardo "
"un billón "
"un billardo "]
[""
"mila"
" milione "
" miliardo "
" billón "
" billardo "]
)
(japanese
"rei"
""
"??"
""
4
[""
" ichi" " ni" " san"
" yon" " go" " roku"
" nana" " hachi" " kyû"
" jû"
" jû ichi" " jû ni" " jû san"
" jû yon" " jû go" " jû roku"
" jû nana" " jû hachi" " jû kyû"
" nijû"
" nijû ichi" " nijû ni" " nijû san"
" nijû yon" " nijû go" " nijû roku"
" nijû nana" " nijû hachi" " nijû kyû"
" sanjû"
" sanjû ichi" " sanjû ni" " sanjû san"
" sanjû yon" " sanjû go" " sanjû roku"
" sanjû nana" " sanjû hachi" " sanjû kyû"
" yonjû"
" yonjû ichi" " yonjû ni" " yonjû san"
" yonjû yon" " yonjû go" " yonjû roku"
" yonjû nana" " yonjû hachi" " yonjû kyû"
" gojû"
" gojû ichi" " gojû ni" " gojû san"
" gojû yon" " gojû go" " gojû roku"
" gojû nana" " gojû hachi" " gojû kyû"
" rokujû"
" rokujû ichi" " rokujû ni" " rokujû san"
" rokujû yon" " rokujû go" " rokujû roku"
" rokujû nana" " rokujû hachi" " rokujû kyû"
" nanajû"
" nanajû ichi" " nanajû ni" " nanajû san"
" nanajû yon" " nanajû go" " nanajû roku"
" nanajû nana" " nanajû hachi" " nanajû kyû"
" hachijû"
" hachijû ichi" " hachijû ni" " hachijû san"
" hachijû yon" " hachijû go" " hachijû roku"
" hachijû nana" " hachijû hachi" " hachijû kyû"
" kyûjû"
" kyûjû ichi" " kyûjû ni" " kyûjû san"
" kyûjû yon" " kyûjû go" " kyûjû roku"
" kyûjû nana" " kyûjû hachi" " kyûjû kyû"]
[""
" hyaku"
" nihyaku"
" sambyaku"
" yonhyaku"
" gohyaku"
" roppyaku"
" nanahyaku"
" happyaku"
" kyûhyaku"]
[""
" hyaku"
" nihyaku"
" sambyaku"
" yonhyaku"
" gohyaku"
" roppyaku"
" nanahyaku"
" happyaku"
" kyûhyaku"]
[" ichi"
" sen"
" ichiman"
" ichioku"
" itchô"
" ikkei"]
[""
"sen"
"man"
"oku"
"chô"
"kei"]
[
[
nil
[4 "issen" nil nil "itchô" "ikkei"]
nil
[3 "sanzen" "samman" nil nil "sankei"]
[3 nil "yomman" nil nil nil]
nil
[4 nil nil nil nil "rokkei"]
nil
[5 "hassen" nil nil "hatchô" "hakkei"]
nil]
[2 "jussen" nil nil "jutchô" "jukkei"]
[3 nil nil nil nil "hyakkei"]
[3 nil "semman" nil nil nil]]
)
(norwegian
"null"
","
"minus"
" og"
3
[""
" en" " to" " tre"
" fire" " fem" " seks"
" syv" " åtte" " ni"
" ti"
" elleve" " tolv" " tretten"
" fjorten" " femten" " seksten"
" søtten" " atten" " nitten"
" tyve"
" tjueen" " tjueto" " tjuetre"
" tjuefire" " tjuefem" " tjueseks"
" tjuesyv" " tjueåtte" " tjueni"
" tretti"
" trettien" " trettito" " trettitre"
" trettifire" " trettifem" " trettiseks"
" trettisyv" " trettiåtte" " trettini"
" førti"
" førtien" " førtito" " førtitre"
" førtifire" " førtifem" " førtiseks"
" førtisyv" " førtiåtte" " førtini"
" femti"
" femtien" " femtito" " femtitre"
" femtifire" " femtifem" " femtiseks"
" femtisyv" " femtiåtte" " femtini"
" seksti"
" sekstien" " sekstito" " sekstitre"
" sekstifire" " sekstifem" " sekstiseks"
" sekstisyv" " sekstiåtte" " sekstini"
" sytti"
" syttien" " syttito" " syttitre"
" syttifire" " syttifem" " syttiseks"
" syttisyv" " syttiåtte" " syttini"
" åtti"
" åttien" " åttito" " åttitre"
" åttifire" " åttifem" " åttiseks"
" åttisyv" " åttiåtte" " åttini"
" nitti"
" nittien" " nittito" " nittitre"
" nittifire" " nittifem" " nittiseks"
" nittisyv" " nittiåtte" " nittini"]
[""
" ett hundre"
" to hundre"
" tre hundre"
" fire hundre"
" fem hundre"
" seks hundre"
" syv hundre"
" åtte hundre"
" ni hundre"]
[""
" ett hundre og"
" to hundre og"
" tre hundre og"
" fire hundre og"
" fem hundre og"
" seks hundre og"
" syv hundre og"
" åtte hundre og"
" ni hundre og"]
[" ett"
" ett tusen"
" en million"
" en milliard"
" en billion"
" en billiard"]
[""
" tusen"
" millioner"
" milliarder"
" billioner"
" billiarder"]
)
(portuguese-br
"zero"
","
"menos"
" e"
3
[""
[" uma" " um" nil] [" duas" " dois" nil] " três"
" quatro" " cinco" " seis"
" sete" " oito" " nove"
" dez"
" onze" " doze" " treze"
" quatorze" " quinze" " dezesseis"
" dezessete" " dezoito" " dezenove"
" vinte"
[" vinte e uma" " vinte e um" nil]
[" vinte e duas" " vinte e dois" nil] " vinte e três"
" vinte e quatro" " vinte e cinco" " vinte e seis"
" vinte e sete" " vinte e oito" " vinte e nove"
" trinta"
[" trinta e uma" " trinta e um" nil]
[" trinta e duas" " trinta e dois" nil] " trinta e três"
" trinta e quatro" " trinta e cinco" " trinta e seis"
" trinta e sete" " trinta e oito" " trinta e nove"
" quarenta"
[" quarenta e uma" " quarenta e um" nil]
[" quarenta e duas" " quarenta e dois" nil] " quarenta e três"
" quarenta e quatro" " quarenta e cinco" " quarenta e seis"
" quarenta e sete" " quarenta e oito" " quarenta e nove"
" cinqüenta"
[" cinqüenta e uma" " cinqüenta e um" nil]
[" cinqüenta e duas" " cinqüenta e dois" nil] " cinqüenta e três"
" cinqüenta e quatro" " cinqüenta e cinco" " cinqüenta e seis"
" cinqüenta e sete" " cinqüenta e oito" " cinqüenta e nove"
" sessenta"
[" sessenta e uma" " sessenta e um" nil]
[" sessenta e duas" " sessenta e dois" nil] " sessenta e três"
" sessenta e quatro" " sessenta e cinco" " sessenta e seis"
" sessenta e sete" " sessenta e oito" " sessenta e nove"
" setenta"
[" setenta e uma" " setenta e um" nil]
[" setenta e duas" " setenta e dois" nil] " setenta e três"
" setenta e quatro" " setenta e cinco" " setenta e seis"
" setenta e sete" " setenta e oito" " setenta e nove"
" oitenta"
[" oitenta e uma" " oitenta e um" nil]
[" oitenta e duas" " oitenta e dois" nil] " oitenta e três"
" oitenta e quatro" " oitenta e cinco" " oitenta e seis"
" oitenta e sete" " oitenta e oito" " oitenta e nove"
" noventa"
[" noventa e uma" " noventa e um" nil]
[" noventa e duas" " noventa e dois" nil] " noventa e três"
" noventa e quatro" " noventa e cinco" " noventa e seis"
" noventa e sete" " noventa e oito" " noventa e nove"]
[""
" cem"
[" duzentas" " duzentos" nil]
[" trezentas" " trezentos" nil]
[" quatrocentas" " quatrocentos" nil]
[" quinhentas" " quinhentos" nil]
[" seiscentas" " seiscentos" nil]
[" setecentas" " setecentos" nil]
[" oitocentas" " oitocentos" nil]
[" novecentas" " novecentos" nil]]
[""
" cento e"
[" duzentas e" " duzentos e" nil]
[" trezentas e" " trezentos e" nil]
[" quatrocentas e" " quatrocentos e" nil]
[" quinhentas e" " quinhentos e" nil]
[" seiscentas e" " seiscentos e" nil]
[" setecentas e" " setecentos e" nil]
[" oitocentas e" " oitocentos e" nil]
[" novecentas e" " novecentos e" nil]]
[[" uma" " um" nil]
" um mil"
" um milhão"
" um bilhão"
" um trilhão"
" um quatrilhão"]
[""
" mil"
" milhões"
" bilhões"
" trilhões"
" quatrilhões"]
)
(portuguese-pt
"zero"
","
"menos"
" e"
6
[""
[" uma" " um" nil] [" duas" " dois" nil] " três"
" quatro" " cinco" " seis"
" sete" " oito" " nove"
" dez"
" onze" " doze" " treze"
" catorze" " quinze" " dezasseis"
" dezassete" " dezoito" " dezanove"
" vinte"
[" vinte e uma" " vinte e um" nil]
[" vinte e duas" " vinte e dois" nil] " vinte e três"
" vinte e quatro" " vinte e cinco" " vinte e seis"
" vinte e sete" " vinte e oito" " vinte e nove"
" trinta"
[" trinta e uma" " trinta e um" nil]
[" trinta e duas" " trinta e dois" nil] " trinta e três"
" trinta e quatro" " trinta e cinco" " trinta e seis"
" trinta e sete" " trinta e oito" " trinta e nove"
" quarenta"
[" quarenta e uma" " quarenta e um" nil]
[" quarenta e duas" " quarenta e dois" nil] " quarenta e três"
" quarenta e quatro" " quarenta e cinco" " quarenta e seis"
" quarenta e sete" " quarenta e oito" " quarenta e nove"
" cinqüenta"
[" cinqüenta e uma" " cinqüenta e um" nil]
[" cinqüenta e duas" " cinqüenta e dois" nil] " cinqüenta e três"
" cinqüenta e quatro" " cinqüenta e cinco" " cinqüenta e seis"
" cinqüenta e sete" " cinqüenta e oito" " cinqüenta e nove"
" sessenta"
[" sessenta e uma" " sessenta e um" nil]
[" sessenta e duas" " sessenta e dois" nil] " sessenta e três"
" sessenta e quatro" " sessenta e cinco" " sessenta e seis"
" sessenta e sete" " sessenta e oito" " sessenta e nove"
" setenta"
[" setenta e uma" " setenta e um" nil]
[" setenta e duas" " setenta e dois" nil] " setenta e três"
" setenta e quatro" " setenta e cinco" " setenta e seis"
" setenta e sete" " setenta e oito" " setenta e nove"
" oitenta"
[" oitenta e uma" " oitenta e um" nil]
[" oitenta e duas" " oitenta e dois" nil] " oitenta e três"
" oitenta e quatro" " oitenta e cinco" " oitenta e seis"
" oitenta e sete" " oitenta e oito" " oitenta e nove"
" noventa"
[" noventa e uma" " noventa e um" nil]
[" noventa e duas" " noventa e dois" nil] " noventa e três"
" noventa e quatro" " noventa e cinco" " noventa e seis"
" noventa e sete" " noventa e oito" " noventa e nove"]
[""
" cem"
[" duzentas" " duzentos" nil]
[" trezentas" " trezentos" nil]
[" quatrocentas" " quatrocentos" nil]
[" quinhentas" " quinhentos" nil]
[" seiscentas" " seiscentos" nil]
[" setecentas" " setecentos" nil]
[" oitocentas" " oitocentos" nil]
[" novecentas" " novecentos" nil]]
[""
" cento e"
[" duzentas e" " duzentos e" nil]
[" trezentas e" " trezentos e" nil]
[" quatrocentas e" " quatrocentos e" nil]
[" quinhentas e" " quinhentos e" nil]
[" seiscentas e" " seiscentos e" nil]
[" setecentas e" " setecentos e" nil]
[" oitocentas e" " oitocentos e" nil]
[" novecentas e" " novecentos e" nil]]
[[" uma" " um" nil]
" um mil"
" um milhão"
" um bilhão"
" um trilhão"
" um quatrilhão"]
[""
" mil"
" milhões"
" bilhões"
" trilhões"
" quatrilhões"]
)
(spanish
"cero"
""
"menos"
" y"
6
[""
[" una" " un" "uno"] " dos" " tres"
" cuatro" " cinco" " seis"
" siete" " ocho" " nueve"
" diez"
" once" " doce" " trece"
" catorce" " quince" " dieciséis"
" diecisiete" " dieciocho" " diecinueve"
" veinte"
[" veintiuna" " veintiun" " veintiuno"]
" veintidós" " veintitrés"
" veinticuatro" " veinticinco" " veintiseis"
" veintisiete" " veintiocho" " veintinueve"
" treinta"
[" treinta y una" " treinta y un" " treinta y uno"]
" treinta y dos" " treinta y tres"
" treinta y cuatro" " treinta y cinco" " treinta y seis"
" treinta y siete" " treinta y ocho" " treinta y nueve"
" cuarenta"
[" cuarenta y una" " cuarenta y un" " cuarenta y uno"]
" cuarenta y dos" " cuarenta y tres"
" cuarenta y cuatro" " cuarenta y cinco" " cuarenta y seis"
" cuarenta y siete" " cuarenta y ocho" " cuarenta y nueve"
" cincuenta"
[" cincuenta y una" " cincuenta y un" " cincuenta y uno"]
" cincuenta y dos" " cincuenta y tres"
" cincuenta y cuatro" " cincuenta y cinco" " cincuenta y seis"
" cincuenta y siete" " cincuenta y ocho" " cincuenta y nueve"
" sesenta"
[" sesenta y una" " sesenta y un" " sesenta y uno"]
" sesenta y dos" " sesenta y tres"
" sesenta y cuatro" " sesenta y cinco" " sesenta y seis"
" sesenta y siete" " sesenta y ocho" " sesenta y nueve"
" setenta"
[" setenta y una" " setenta y un" " setenta y uno"]
" setenta y dos" " setenta y tres"
" setenta y cuatro" " setenta y cinco" " setenta y seis"
" setenta y siete" " setenta y ocho" " setenta y nueve"
" ochenta"
[" ochenta y una" " ochenta y un" " ochenta y uno"]
" ochenta y dos" " ochenta y tres"
" ochenta y cuatro" " ochenta y cinco" " ochenta y seis"
" ochenta y siete" " ochenta y ocho" " ochenta y nueve"
" noventa"
[" noventa y una" " noventa y un" " noventa y uno"]
" noventa y dos" " noventa y tres"
" noventa y cuatro" " noventa y cinco" " noventa y seis"
" noventa y siete" " noventa y ocho" " noventa y nueve"]
[""
" cien"
[" doscientas" " doscientos" nil]
[" trescientas" " trescientos" nil]
[" cuatrocientas" " cuatrocientos" nil]
[" quinientas" " quinientos" nil]
[" seiscientas" " seiscientos" nil]
[" setecientas" " setecientos" nil]
[" ochocientas" " ochocientos" nil]
[" novecientas" " novecientos" nil]]
[""
" ciento"
[" doscientas" " doscientos" nil]
[" trescientas" " trescientos" nil]
[" cuatrocientas" " cuatrocientos" nil]
[" quinientas" " quinientos" nil]
[" seiscientas" " seiscientos" nil]
[" setecientas" " setecientos" nil]
[" ochocientas" " ochocientos" nil]
[" novecientas" " novecientos" nil]]
[[" una" " un" " uno"]
" mil"
" un millón"
" un billón"
" un trillón"
" un cuadrillón"]
[""
" mil"
" millones"
" billones"
" trillones"
" cuadrillones"]
)
(swedish
"null"
","
"minus"
" och"
3
[""
" ett" " två" " tre"
" fyra" " fem" " sex"
" sju" " åtta" " nio"
" tio"
" elva" " tolv" " tretton"
" fjorton" " femton" " sexton"
" sjutton" " arton" " nitton"
" tjugo"
" tjugoett" " tjugotvå" " tjugotre"
" tjugofyra" " tjugofem" " tjugosex"
" tjugosju" " tjugoåtta" " tjugonio"
" trettio"
" trettiett" " trettitvå" " trettitre"
" trettifyra" " trettifem" " trettisex"
" trettisju" " trettiåtta" " trettinio"
" fyrtio"
" fyrtiett" " fyrtitvå" " fyrtitre"
" fyrtifyra" " fyrtifem" " fyrtisex"
" fyrtisju" " fyrtiåtta" " fyrtinio"
" femtio"
" femtiett" " femtitvå" " femtitre"
" femtifyra" " femtifem" " femtisex"
" femtisju" " femtiåtta" " femtinio"
" sextio"
" sextiett" " sextitvå" " sextitre"
" sextifyra" " sextifem" " sextisex"
" sextisju" " sextiåtta" " sextinio"
" sjuttio"
" sjuttiett" " sjuttitvå" " sjuttitre"
" sjuttifyra" " sjuttifem" " sjuttisex"
" sjuttisju" " sjuttiåtta" " sjuttinio"
" åttio"
" åttiett" " åttitvå" " åttitre"
" åttifyra" " åttifem" " åttisex"
" åttisju" " åttiåtta" " åttinio"
" nittio"
" nittiett" " nittitvå" " nittitre"
" nittifyra" " nittifem" " nittisex"
" nittisju" " nittiåtta" " nittinio"]
[""
" ett hundra"
" två hundra"
" tre hundra"
" fyra hundra"
" fem hundra"
" sex hundra"
" sju hundra"
" åtta hundra"
" nio hundra"]
[""
" ett hundra och"
" två hundra och"
" tre hundra och"
" fyra hundra och"
" fem hundra och"
" sex hundra och"
" sju hundra och"
" åtta hundra och"
" nio hundra och"]
[" ett"
" ett tusen"
" en milljon"
" en milljard"
" en billjon"
" en billjard"]
[""
" tusen"
" milljoner"
" milljarder"
" billjoner"
" billjarder"]
)
)
"Alist where each element has the following form:
(LANGUAGE
;; 0 - zero
0
;; 1 - comma
\",\"
;; 2 - minus (negative numbers)
\"minus\"
;; 3 - and (for example: one thousand AND one)
;; (special case in some languages, see text below)
\"\"
;; 4 - digits per period
;; (for example: 3 - american english has period each 1,000;
;; 4 - japanese has period each 10,000;
;; 6 - spanish has period each 1,000,000)
3
;; 5 - tens [0-99]
[\"\"
1 2 3
4 5 6
7 8 9
10
11 12 13
14 15 16
17 18 19
20
...
97 98 99]
;; 6 - hundreds [0-9] (for example: one hundred)
[\"\" 100 200 .. 900]
;; 7 - hundreds-tens [0-9] (for example: one hundred AND ten)
;; (special case in some languages)
[\"\" 100 200 .. 900]
;; 8 - singular period (like one, one thousand, one million, etc.)
[1
1,000
1,000,000
1,000,000,000
1,000,000,000,000
1,000,000,000,000,000]
;; 9 - plural period (like thousands, millions, etc.)
[\"\"
1,000
1,000,000
1,000,000,000
1,000,000,000,000
1,000,000,000,000,000]
;; 10 - extras (optional - special cases in some languages)
[;; 0 - units
[nil ; unit 0
[4 \"str\" nil nil \"str\" \"str\"] ; unit 1
nil ; unit 2
[3 \"str\" \"str\" nil nil \"str\"] ; unit 3
[3 nil \"str\" nil nil nil ] ; unit 4
nil ; unit 5
[4 nil nil nil nil \"str\"] ; unit 6
nil ; unit 7
[5 \"str\" nil nil nil nil ] ; unit 8
nil] ; unit 9
;; 1 - tens
[2 \"str\" nil nil \"str\" \"str\"]
;; 2 - hundreds
[3 nil nil nil nil \"str\"]
;; 3 - thousands
[3 nil \"str\" nil nil nil]]
)
The numbers should be spelled out in a string or in a vector like:
[FEMININE MASCULINE NEUTER]
Where FEMININE, MASCULINE and NEUTER are strings representing number in
feminine, masculine and neuter gender, respectively. If there is no neuter, it
should be nil.
The string representation is used when all gender (feminine, masculine and
neuter) has the same spelling.
NOTE: The gender engine is designed for spelling out number and currency.
It's beyond the scope of gender engine to handle general gender in all
languages.
There are cases where the NEUTER gender used by `spell-number' differs
from the usual way that NEUTER gender is used in a language. This is a
trick used to spell out numbers correctly.
Some language may have two ways to express \"and\" in `;; 3 - and', one for
numbers until million (like one thousand AND one) and other for numbers above
million (like one million AND one), in this case, instead of a string, use a
vector like:
[\"one and - thousand\" \"other and - million\"]
For an example, see `german' entry.
The item `;; 10 - extras' is optional and is only used in some languages that
has special rules about spelling a number, like `japanese' (see the entry as an
example). The idea is that the spelling of some numbers are changed when used
is conjunction with some power of 10. For example, in `japanese' the number 2
is spelled `ni' and the period 1,000 is spelled `sen', so 2,000 is spelled
`nisen'. When using the number 3 (`san'), the number 3,000 is not spelled
`sansen', but `sanzen'. In `japanese', the power of 10 used by `spell-number'
are 10, 10^2, 10^3, 10^4, 10^8, 10^12 and 10^16.
The `;; 10 - extras' item is a vector with the following form:
[UNITS TENS HUNDREDS THOUSANDS]
Where UNITS is used when a unit is joined with a power of 10 has some spelling
modification. It's nil, if there is no special case; or is a vector with the
following form:
[UNIT-0 UNIT-1 ... UNIT-9]
Where UNIT-0, UNIT-1, ... and UNIT-9 has the same values as TENS, HUNDREDS and
THOUSANDS.
TENS is used when the multiples of 10 (10, 20, 30, ... and 90) is joined with
a power of 10 (above 10).
HUNDREDS is used when the multiples of 100 (100, 200, 300, ... and 900) is
joined with a power of 10 (above 10^2).
THOUSANDS is used when the multiples of 1000 (1000, 2000, 3000, ... and 9000)
is joined with a power of 10 (above 10^3).
TENS, HUNDREDS and THOUSANDS can be nil, if there is no special case; or can be
a vector with the following form:
[N S1 S2 S3 S4 S5]
Where,
S1 is used when joining a unit/power with 10^3.
S2 is used when joining a unit/power with 10^4.
S3 is used when joining a unit/power with 10^8.
S4 is used when joining a unit/power with 10^12.
S5 is used when joining a unit/power with 10^16.
S1, S2, S3, S4 and S5 can be nil if there is no special case; or can be a
string, in this case, N characters will be removed from the tail of unit string
and then will be concated with the corresponding S1, S2, S3, S4 or S5.")
(defconst spelln-currency-database
'(
(andorra-french
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(andorra-spanish
[" peseta" " pesetas" " y " feminine]
[" céntimo" " céntimos" 100 masculine]
)
(antigua-and-barbuda
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(argentina
[" peso" " pesos" " y " masculine]
[" centavo" " centavos" 100 masculine]
)
(australia
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(austria
[" Schilling" " Schilling" " und " neuter]
[" Groschen" " Groschen" 100 neuter]
)
(bahamas
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(barbados
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(belgium
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(belize
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(benin
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(bolivia
[" boliviano" " bolivianos" " y " masculine]
[" peso" " pesos" 1000 masculine]
)
(brazil
[" real" " reais" " e " masculine]
[" centavo" " centavos" 100 masculine]
)
(brunei
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(burkina-faso
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(burundi
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(cameroon
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(canada
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(cape-verde
[" escudo" " escudos" " e " masculine]
[" centavo" " centavos" 100 masculine]
)
(central-african-republic
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(chad
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(chile
[" peso" " pesos" " y " masculine]
[" centésimo" " centésimos" 100 masculine]
)
(colombia
[" peso" " pesos" " y " masculine]
[" centavo" " centavos" 100 masculine]
)
(comoros
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(congo
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(costa-rica
[" colón" " colones" " y " masculine]
[" céntimo" " céntimos" 100 masculine]
)
(cuba
[" peso" " pesos" " y " masculine]
[" centavo" " centavos" 100 masculine]
)
(cyprus
[" pound" " pounds" " and " neuter]
[" cent" " cents" 100 neuter]
)
(denmark
[" krone" " kroner" " og " neuter]
[" øre" " ører" 100 neuter]
)
(djibouti
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(dominica
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(dominican-republic
[" peso" " pesos" " y " masculine]
[" centavo" " centavos" 100 masculine]
)
(ecuador
[" sucre" " sucres" " y " masculine]
[" centavo" " centavos" 100 masculine]
)
(el-salvador
[" colón" " colones" " y " masculine]
[" centavo" " centavos" 100 masculine]
)
(equatorial-guinea
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(fiji
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(finland
[" euro" " euroa" " ja " neuter]
[" senttiä" " senttiä" 100 neuter]
)
(france
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(gabon
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(germany
[" Mark" " Mark" " und " feminine]
[" Pfennig" " Pfennig" 100 masculine]
)
(grenada
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(guatemala
[" quetzal" " quetzals" " y " masculine]
[" centavo" " centavos" 100 masculine]
)
(guinea
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(guinea-bissau
[" peso" " pesos" " y " masculine]
[" centavo" " centavos" 100 masculine]
)
(guyana
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(haiti
[" gourde" " gourdes" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(honduras
[" lempira" " lempiras" " y " feminine]
[" centavo" " centavos" 100 masculine]
)
(ireland
[" pound" " pounds" " and " neuter]
[" penny" " pence" 100 neuter]
)
(italy
[" lira" " lire" " e " neuter]
[" centesimo" " centesimo" 100 neuter]
)
(ivory-coast
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(jamaica
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(japan
["en" "en" "" neuter]
["" "" 0 neuter]
["n$" "n '"]
["\\([^']\\)$" "\\1 "]
)
(kenya
[" shilling" " shillings" " and " neuter]
[" cent" " cents" 100 neuter]
)
(kiribati
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(liberia
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(liechtenstein
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(luxembourg
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(madagascar
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(mali
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(mexico
[" peso" " pesos" " y " masculine]
[" centavo" " centavos" 100 masculine]
)
(monaco
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(mozambique
[" metical" " meticals" " e " masculine]
[" centavo" " centavos" 100 masculine]
)
(namibia
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(nauru
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(netherlands
[" guilder" " guilder" " en " masculine]
[" cent" " cent" 100 masculine]
)
(new-zealand
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(nicaragua
[" córdoba" " córdobas" " y " masculine]
[" centavo" " centavos" 100 masculine]
)
(niger
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(norway
[" krone" " kroner" " og " neuter]
[" øre" " ører" 100 neuter]
)
(panama
[" balboa" " balboas" " y " neuter]
[" cent" " cents" 100 neuter]
)
(paraguay
[" guaraní" " guaranís" " y " neuter]
[" céntimo" " céntimos" 100 masculine]
)
(peru
[" sol" " soles" " y " neuter]
[" céntimo" " céntimos" 100 masculine]
)
(philippines
[" peso" " pesos" " y " masculine]
[" centavo" " centavos" 100 masculine]
)
(portugal
[" escudo" " escudos" " e " masculine]
[" centavo" " centavos" 100 masculine]
)
(rwanda
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(sao-tome-and-principe
[" dobra" " dobras" " y " feminine]
[" centavo" " centavos" 100 masculine]
)
(senegal
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(singapore
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(solomon-islands
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(somalia
[" shilling" " shillings" " and " neuter]
[" cent" " cents" 100 neuter]
)
(south-africa
[" rand" " rands" " and " neuter]
[" cent" " cents" 100 neuter]
)
(spain
[" peseta" " pesetas" " y " feminine]
[" céntimo" " céntimos" 100 masculine]
)
(st-kitts-and-nevis
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(st-lucia
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(st-vicent-and-grenadines
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(sweden
[" krona" " kronor" " och " neuter]
[" öre" " ören" 100 neuter]
)
(switzerland
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(taiwan
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(tanzania
[" shilling" " shillings" " and " neuter]
[" cent" " cents" 100 neuter]
)
(togo
[" franc" " francs" " et " neuter]
[" centime" " centimes" 100 neuter]
)
(trinidad-and-tobago
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(tuvalu
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(uganda
[" shilling" " shillings" " and " neuter]
[" cent" " cents" 100 neuter]
)
(united-kingdom
[" pound" " pounds" " and " neuter]
[" penny" " pence" 100 neuter]
)
(united-states
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
(uruguay
[" peso" " pesos" " y " masculine]
[" centésimo" " centésimos" 100 masculine]
)
(venezuela
[" bolívar" " bolívares" " y " masculine]
[" céntimo" " céntimos" 100 masculine]
)
(zimbabwe
[" dollar" " dollars" " and " neuter]
[" cent" " cents" 100 neuter]
)
)
"Alist where each element has the following form:
(COUNTRY
;; 0 - currency
[\" dollar\" \" dollars\" \" and \" GENDER]
;; 1 - fractional
[\" cent\" \" cents\" 100 GENDER]
;; 2 - extras (optional)
[SEARCH-REGEXP REPLACE-REGEXP]...
)
Where GENDER indicates the word gender. Valid values are `feminine',
`masculine' or `neuter'. Any other value is treated as `neuter'.
The `;; 2 - extras' item is optional and it's used by some languages that has
special rules in spelling numbers with currency, like japanese language (see
`japan' entry). The rules are applied only in the currency part (item 0).
The rules are specified by vectors with the following form:
[SEARCH-REGEXP REPLACE-REGEXP]
So, the currency part is searched by SEARCH-REGEXP, if there is a match, the
REPLACE-REGEXP is used to replace the matching.")
(defun spelln-string-match (match str)
(let (case-fold-search)
(or (and (string-match match str)
(= (match-beginning 0) 0)
(= (match-end 0) (length str)))
(error "Invalid numeric string for spelling out: %S" str))))
(defun spelln-number-customize ()
"Customize spelln-number options."
(interactive)
(customize-group 'spelln-number))
(defun spelln-integer-in-words (int &optional gender-sym)
"Return the spelling of integer INT in words.
Optionally, GENDER-SYM specifies the spelling gender.
Valid values for GENDER-SYM are: 'feminine, 'masculine or 'neuter.
Any other value is treated as 'neuter."
(interactive "nInteger to spell out in words: ")
(let* ((integer-base (cdr (assq spelln-language spelln-language-database)))
(spelln-zero (nth 0 integer-base))
(spelln-comma (nth 1 integer-base))
(spelln-minus (nth 2 integer-base))
(spelln-and (nth 3 integer-base))
(spelln-digits-period (nth 4 integer-base))
(spelln-tens (nth 5 integer-base))
(spelln-hundreds (nth 6 integer-base))
(spelln-hundreds-tens (nth 7 integer-base))
(spelln-singular-period (nth 8 integer-base))
(spelln-plural-period (nth 9 integer-base))
(spelln-extra (nth 10 integer-base))
(spell (and integer-base
(spelln-int int gender-sym))))
(and spell
(interactive-p)
(message spell))
spell))
(defun spelln-currency-in-words (value)
"Return the spelling of number VALUE as a currency in words."
(interactive "nCurrency to spell out in words: ")
(let* ((integer-base (cdr (assq spelln-language spelln-language-database)))
(spelln-zero (nth 0 integer-base))
(spelln-comma (nth 1 integer-base))
(spelln-minus (nth 2 integer-base))
(spelln-and (nth 3 integer-base))
(spelln-digits-period (nth 4 integer-base))
(spelln-tens (nth 5 integer-base))
(spelln-hundreds (nth 6 integer-base))
(spelln-hundreds-tens (nth 7 integer-base))
(spelln-singular-period (nth 8 integer-base))
(spelln-plural-period (nth 9 integer-base))
(spelln-extra (nth 10 integer-base))
(country-base (cdr (assq spelln-country spelln-currency-database)))
(spelln-currency (nth 0 country-base))
(spelln-fractional (nth 1 country-base))
(spelln-currency-extra (nthcdr 2 country-base))
(money (truncate value))
(frac (abs (round (* (- value money) (aref spelln-fractional 2)))))
(spell (and integer-base country-base
(concat
(spelln-currency-extra
(spelln-int money (aref spelln-currency 3)))
(aref spelln-currency
(if (or (= money 1) (= money -1))
0
1))
(and (or (/= frac 0)
spelln-zero-cents)
(concat (aref spelln-currency 2)
(spelln-int frac
(aref spelln-fractional 3))
(aref spelln-fractional
(if (= frac 1)
0
1))))))))
(and spell
(interactive-p)
(message spell))
spell))
(defun spelln-numeric-string-in-words (str &optional gender-sym)
"Return the spelling of a numeric string STR in words.
STR should match the regexp \"[-+]?[0-9P]+\", where P is the value of variable
`spelln-period-character'.
For: (setq spelln-period-character ?,)
A valid numeric string is \"+1,234,567\" or \"1234567\".
Optionally, GENDER-SYM specifies the spelling gender.
Valid values for GENDER-SYM are: 'feminine, 'masculine or 'neuter.
Any other value is treated as 'neuter."
(interactive "sNumeric string to spell out in words: ")
(let* ((integer-base (cdr (assq spelln-language spelln-language-database)))
(spelln-zero (nth 0 integer-base))
(spelln-comma (nth 1 integer-base))
(spelln-minus (nth 2 integer-base))
(spelln-and (nth 3 integer-base))
(spelln-digits-period (nth 4 integer-base))
(spelln-tens (nth 5 integer-base))
(spelln-hundreds (nth 6 integer-base))
(spelln-hundreds-tens (nth 7 integer-base))
(spelln-singular-period (nth 8 integer-base))
(spelln-plural-period (nth 9 integer-base))
(spelln-extra (nth 10 integer-base))
(spell (and (save-match-data
(spelln-string-match
(concat "[-+]?[0-9"
(regexp-quote
(char-to-string spelln-period-character))
"]+")
str))
(cdr (spelln-str str gender-sym)))))
(and spell
(interactive-p)
(message spell))
spell))
(defun spelln-currency-string-in-words (value)
"Return the spelling of numeric string VALUE as a currency in words.
VALUE should match the regexp \"[-+]?[0-9P]+\\(D[0-9]*\\)?\", where P is the
value of variable `spelln-period-character' and D is the value of variable
`spelln-decimal-character'.
For: (setq spelln-period-character ?,
spelln-decimal-character ?.)
A valid numeric string is \"+1,234,567.89\" or \"1234567.89\"."
(interactive "sCurrency string to spell out in words: ")
(let* ((integer-base (cdr (assq spelln-language spelln-language-database)))
(spelln-zero (nth 0 integer-base))
(spelln-comma (nth 1 integer-base))
(spelln-minus (nth 2 integer-base))
(spelln-and (nth 3 integer-base))
(spelln-digits-period (nth 4 integer-base))
(spelln-tens (nth 5 integer-base))
(spelln-hundreds (nth 6 integer-base))
(spelln-hundreds-tens (nth 7 integer-base))
(spelln-singular-period (nth 8 integer-base))
(spelln-plural-period (nth 9 integer-base))
(spelln-extra (nth 10 integer-base))
(country-base (cdr (assq spelln-country spelln-currency-database)))
(spelln-currency (nth 0 country-base))
(spelln-fractional (nth 1 country-base))
(spelln-currency-extra (nthcdr 2 country-base))
decimal
(spell
(and integer-base country-base
(save-match-data
(and (spelln-string-match
(concat "[-+]?[0-9"
(regexp-quote
(char-to-string spelln-period-character))
"]+\\("
(regexp-quote
(char-to-string spelln-decimal-character))
"[0-9]*\\)?")
value)
(progn
(setq decimal (match-beginning 1))
t)))
(let ((money (spelln-str (if decimal
(substring value 0 decimal)
value)
(aref spelln-currency 3)))
(frac (if (<= (aref spelln-fractional 2) 0)
'(0 . "")
(spelln-str (if decimal
(substring value (1+ decimal))
"0")
(aref spelln-fractional 3)
(truncate
(log10 (aref spelln-fractional 2)))))))
(concat (spelln-currency-extra (cdr money))
(aref spelln-currency
(if (= (car money) 1)
0
1))
(and (or (/= (car frac) 0)
spelln-zero-cents)
(concat (aref spelln-currency 2)
(cdr frac)
(aref spelln-fractional
(if (= (car frac) 1)
0
1)))))))))
(and spell
(interactive-p)
(message spell))
spell))
(provide 'spell-number)