Spec 0.14.0
Malagasy number words: rules and sources
Turns any number from 0 up, whole or decimal, into Malagasy words, as written in the standard (official) language, writes ordinals (fahatelo, third), and reads the words back into the number. The rules have no upper limit; each port stops at its largest exact integer (see [Errors](#errors)). Input is a number value, or plain decimal text such as '2000000000000000.9' when every digit must be exact (rule 13). Digit separators and other notations are not parsed.
Ce contenu n’est pas encore disponible dans votre langue.
-
Zero is
aotra. -
Read from the smallest part upwards. Units come before tens, tens before hundreds, and each larger group follows:
21→iraika amby roapolo(“one over twenty”). -
Joining words depend on what the smaller part is added to:
Added to Word Examples folo(10)ambin'ny11→iraika ambin'ny foloroapolo–sivifolo(20–90)amby34→efatra amby telopolozato(exactly 100)amby105→dimy amby zato;125→dimy amby roapolo amby zatoroanjato–sivinjato(200–900) and every group fromarivosy205→dimy sy roanjato;1 100→zato sy arivo -
ambyup to 199,syfrom 200:348→valo amby efapolo sy telonjato,2 586→enina amby valopolo sy dimanjato sy roa arivo. Exactly 100 keepsamby:1 105→dimy amby zato sy arivo,1 205→dimy sy roanjato sy arivo. Inside a count before a group word (rule 6), every part is joined byambyinstead, so a count is one phrase:280 000 000→valopolo amby roanjato tapitrisa. -
One is
iraikaright beforeambin'nyoramby(11,21,101,121). Beforesyand alone it isiray:1→iray,201→iray sy roanjato,1 001→iray sy arivo. -
Groups of 1000 and above are
arivo(10³),alina(10⁴),hetsy(10⁵),tapitrisa(10⁶) andlavitrisa(10⁹). The count is read before the group word:roa arivo,roapolo tapitrisa.arivo,alinaandhetsytake a count of 1–9 andtapitrisa1–999. A count is one phrase, every part joined byamby(rule 4), so it never containssy:201 000 000→iraika amby roanjato tapitrisa, while200 000 001→iray sy roanjato tapitrisa.lavitrisa, the largest group, takes any count, so numbers of any size are spelled:1 000 000 000 000→arivo lavitrisa,10 000 000 000 000→iray alina lavitrisa,25 000 000 000 000→dimy arivo amby roa alina lavitrisa. -
A count of one is bare only for
arivo:1000→arivo, but10 000→iray alina,100 000→iray hetsy,1 000 000→iray tapitrisa,10⁹→iray lavitrisa.199 102→roa amby zato sy sivy arivo sy sivy alina sy iray hetsy.10and100arefoloandzato(neveriray folo,iray zato). -
Groups are joined by
sy, smallest first:280 000→valo alina sy roa hetsy;2026→enina amby roapolo sy roa arivo. -
Decimals:
faingo, then the decimals read as a whole number. The whole part comes first, thenfaingo(the comma), then the digits after the point, read with every rule above:3.14→telo faingo efatra ambin'ny folo,18.3→valo ambin'ny folo faingo telo. Each leading zero after the point isaotra:0.008→aotra faingo aotra aotra valo,1.05→iray faingo aotra dimy. A whole part of zero isaotra:0.5→aotra faingo dimy. -
The decimals are those of the number value, in its shortest exact decimal form. A number has no trailing zeros (
1.50is1.5), and a whole-valued number has nofaingo(1.0→iray). A binary floating-point value reads as it is:0.1 + 0.2is0.30000000000000004, not0.3. -
Out of scope: negative numbers (decided by the maintainers on 2026-11-27).
-
The traditional system (option
system: traditional) gives every power of ten from 10³ its own name. It is not used in everyday writing, but it is attested in learner material. Each name takes a single digit, 1–9, read with the rules above, and the groups are joined bysy, smallest first. A count of one is bare only forarivo(rule 7). Below 10 000 the two systems write the same words.Power Name Power Name Power Name 10³ arivo10⁹ lavitrisa10¹⁵ tsitamboisafaharoa10⁴ alina10¹⁰ alinkisa10¹⁶ lavitrisafaharoa*10⁵ hetsy10¹¹ tsipesimpesenina10¹⁷ alinkisafaharoa*10⁶ tapitrisa10¹² tsitokotsiforohana10¹⁸ tsipesimpeseninafaharoa*10⁷ safatsiroa10¹³ tsihitanoanoa10⁸ tsitamboisa10¹⁴ safatsiroafaharoa30 000 000→telo safatsiroa(standard:telopolo tapitrisa);12 345 678 901→iray sy sivinjato sy valo arivo sy fito alina sy enina hetsy sy dimy tapitrisa sy efatra safatsiroa sy telo tsitamboisa sy roa lavitrisa sy iray alinkisa.The source names 10⁷–10¹⁵, then skips to 10²¹; its rule is that
<name>faharoa(“the second”) is<name>× 10⁷. * 10¹⁶–10¹⁸ are derived by that rule (asphanisanadoes), so the system names every integer a number value can hold. Decimals afterfaingoare read in the same system (rule 9). No name exists past 10¹⁸, so a number of 10¹⁹ or more, which only decimal text (rule 13) can reach, is written in the standard system. The whole part and the decimals are each one number here:'10000000000000000000'→folo lavitrisa lavitrisain both systems. -
Decimal text is read digit by digit, exactly, with no floating-point rounding:
'2000000000000000.9'→roa tapitrisa lavitrisa faingo sivy, where the number2_000_000_000_000_000.9is already2000000000000001before any port sees it. The text is digits with an optional.and decimals:'12','1500.25'. No sign, space, separator, exponent, or missing digit on either side of the point ('.5','5.'), and at most 100 characters (limits.maxTextLength). Anything else isINVALID_FORMAT. Leading zeros and trailing decimal zeros are dropped, so text reads like the number it writes (rule 10):'007'→fito,'1.50'→iray faingo dimy,'0.0'→aotra. Text has no port limit: every port reads every digit. -
Ordinals (
spellOrdinal) putfahabefore the cardinal words:3→fahatelo,10→fahafolo. Before a vowel it isfah:4→fahefatra,6→fahenina,1000→faharivo.1isvoalohany; a 1 inside a larger number takesfahlike the rest:11→fahiraika ambin'ny folo,21→fahiraika amby roapolo. Input is a whole number from 1, or digit text (rule 13 without a point). Thesystemoption applies. -
Reading words back (
parseWords,safeParseWords,tryParseWords) gives the number thatspellwrites as these words, in either system:roa arivo→2000.- Case, spacing, curly apostrophes and the older spellings
ambin' nyandamby nydo not matter. Anything else must be exactly whatspellwrites:dimy amby roanjato(not how 205 is written) isINVALID_FORMAT. - Text longer than 4096 characters (
limits.maxWordsLength) isINVALID_FORMAT. - The whole part and the decimals are each read up to 15 digits (
limits.maxReadDigits), below one million billion. Larger values areOUT_OF_RANGE: from there on, a few phrases are whatspellwrites for two numbers (dimy amby roapolo tapitrisa lavitrisais both 25 000 000 000 000 000 and 20 000 005 000 000 000), and the reader never guesses. - A number value that cannot hold the result exactly is
PRECISION_LOSS, never a rounded value;{ as: 'text' }gives the exact decimal digits instead.
- Case, spacing, curly apostrophes and the older spellings
Errors
Section titled “Errors”| Input | Code |
|---|---|
Not a number or text, NaN, Infinity |
INVALID_TYPE |
| Text that is not plain decimal (rule 13) | INVALID_FORMAT |
A system other than the two of rule 12 |
INVALID_TYPE |
Below 0 (below 1 for spellOrdinal) |
OUT_OF_RANGE |
| Above the port’s largest exact integer | OUT_OF_RANGE |
spellOrdinal: a number with decimals |
INVALID_TYPE |
parseWords: not text, or an unknown as |
INVALID_TYPE |
parseWords: words spell does not write |
INVALID_FORMAT |
parseWords: more than 15 digits |
OUT_OF_RANGE |
parseWords: a number cannot hold the result |
PRECISION_LOSS |
The spec sets no maximum. For number values, a port stops where its integer type stops being exact (decimal text has no such limit):
| Port | Largest input |
|---|---|
| JavaScript | Number.MAX_SAFE_INTEGER (9 007 199 254 740 991) |
| PHP | PHP_INT_MAX (9 223 372 036 854 775 807, on 64-bit) for fromInt; 9 007 199 254 740 991 for fromFloat |
Shared vectors stay within 9 007 199 254 740 991 so every port runs all of them.
Sources
Section titled “Sources”-
ambyup to 199 andsyfrom 200 (rule 4): Peace Corps Madagascar, Malagasy Language Lessons: “amby is used to connect numbers with one digit to two and three digits until 199. Sy is used after 199 and more.” https://files.peacecorps.gov/multimedia/audio/languagelessons/madagascar/MG_Malagasy_Language_Lessons.pdf. -
sybetween groups and the hundreds of a larger number (7 495→dimy amby sivifolo sy efajato sy fito arivo),arivo lavitrisaandalina lavitrisa: Malagasy Wikipedia, Fanisana amin’ ny teny malagasy and Tapitrisa (Valopolo amby roanjato tapitrisa, 280 000 000, a count joined byamby, as in the dictionary entrytapitrisa). -
Ordinals (rule 14): dictionary entries voalohany and faha (“Before vowels fah- only is added”; “This prefix may be added to all except iray”), and the ordinals table of mylanguages.org.
-
Assimil, Le malgache de poche (2000), as quoted by Languages and Numbers: https://www.languagesandnumbers.com/how-to-count-in-malagasy/en/mlg/. Digits, tens, hundreds,
ambin'ny, and the examples348and2 586. -
Malagasy Dictionary and Encyclopedia of Madagascar (J.-M. de La Beaujardière, linguistic advisors I. Paul, H. Razanarisoa, B. S. Ralalaoherivony, L. Koziol):
- Numbers table: https://malagasyword.org/bins/manisa
- Entries
amby,iraika,aotra,alina,hetsy,tapitrisa,lavitrisa,faingo:https://malagasyword.org/bins/teny2/<word>
-
2026and3.14examples: README of themalagasy-numberwordsLaTeX package (CTAN, 2026), https://ctan.org/pkg/malagasy-numberwords. -
18.3and0.008examples: README of thetanisanpm package, https://unpkg.com/tanisa@1.2.0/README.md. -
Traditional system (rule 12): the names for 10⁷–10¹⁵ and the
faharoarule from Languages and Numbers (quoting Assimil), above. One digit per name, joined bysy, smallest first: the 12 345 678 901 example oftanisa1.1.3, https://unpkg.com/tanisa@1.1.3/README.md, and thephanisanaPHP library, which also derives 10¹⁶–10¹⁸, https://github.com/mamyraoby/phanisana/blob/main/src/Enum/Dictionary.php.
Waiting for a source or an expert
Section titled “Waiting for a source or an expert”Not in the data until a source settles them, or a Malagasy language expert reviews them.
- Nothing is waiting. Negative numbers were not added (rule 11): Malagasy Wikipedia defines
them as numbers
latsaky ny aotra(“below zero”, Isa miiba) but spells none in words.
Recorded disagreements
Section titled “Recorded disagreements”- Spelling of two traditional names (rule 12).
phanisanawritestsipesimpesina(10¹¹) andtsitanoanoa(10¹³); Languages and Numbers (Assimil) writestsipesimpeseninaandtsihitanoanoa. The data follows Assimil, the project’s reference, including in the derivedtsipesimpeseninafaharoa(10¹⁸). Decided by the maintainers on 2026-11-27. syfrom 200 (rule 4). The Peace Corps lessons usesyafter 199. Assimil writes348→valo amby efapolo amby telonjatoand Malagasy Wikipedia239→sivy amby telopolo amby roanjato(ambybelow 1000). The data follows the Peace Corps rule, which also matches2 586and7 495. Decided by the maintainers on 2026-11-27.ambyinside a count (rules 4 and 6). The dictionary entrytapitrisaand Malagasy Wikipedia writevalopolo amby roanjato tapitrisa(280 000 000). The data joins every part of a count byamby, so201 000 000(iraika amby roanjato tapitrisa) and200 000 001(iray sy roanjato tapitrisa) stay apart. Decided by the maintainers on 2026-11-27.- Ordinals with a vowel (rule 14). mylanguages.org writes
fahaeninaandfahaefatra; the dictionary entryfahaadds onlyfahbefore a vowel. The data follows the dictionary:fahenina,fahefatra. The same table writes 12th and 13th asfaha-roapoloandfaha-telopolo(the forms for 20th and 30th) and repeats the 16th for the 18th; those rows are not used. ambin'nyvsambin' ny. The dictionary writesambin' ny; Assimil and everyday writing useambin'ny. Since spec 0.3.0 the data followsambin'ny, with an ASCII apostrophe (Assimil prints a typographic’).isavsirayfor 1. The dictionary’s numbers table listsisa(the counting form); itsirayentry givesirayas the adjective “one”, which is the form used in sentences and in Assimil. The data followsiray.iray alinavsalina. The dictionary’s numbers table and Assimil give the bare words (alina,hetsy,tapitrisa,lavitrisa). Since spec 0.4.0 the data writesiraybefore every group exceptarivo, as in everyday and learner usage. Decided by the maintainers on 2026-11-25.- Counts of 1000 and more before
lavitrisa(rule 6). Malagasy Wikipedia writesarivo lavitrisa(1 000 000 000 000) andalina lavitrisa(10 000 000 000 000): the count is a number of any size. The data does the same, withiraybeforealina(rule 7):iray alina lavitrisa. - Leading zeros after
faingo(rule 9).tanisareads each one asaotra(0.008→aotra faingo aotra aotra valo). Themalagasy-numberwordsguide lists it as a known limitation that3,05may be read as5instead of zero then five. The data followstanisa, so1.05and1.5stay different. Decided by the maintainers on 2026-11-26. - Largest-first for millions. Some texts put the millions first (
dimy tapitrisa sy …). The dictionary and Assimil read every number from the smallest part up; the data follows them. - Older
roa amby ny folo(12). Theambyandlavitrisaentries quote this older form; Assimil mentionsamby nytoo. The data usesambin'ny.