Module talk:Formatnum/testcases
12 tests failed.
Text | Expected | Actual | |
---|---|---|---|
![]() | {{Formatnum|0|en}} | 0 | 0 |
![]() | {{Formatnum|-123|en}} | −123 | −123 |
Text | Expected | Actual | |
---|---|---|---|
Comparing Formatnum with Formatnum/old: "Expected" means using Formatnum/old | |||
![]() | {{Formatnum|100|en|prec=1}} | Template:Formatnum/old | 100.0 |
![]() | {{Formatnum|100.0|en|prec=1}} | Template:Formatnum/old | 100.0 |
![]() | {{Formatnum|100.01|en|prec=2}} | Template:Formatnum/old | 100.01 |
![]() | {{Formatnum|100.01|en|prec=3}} | Template:Formatnum/old | 100.010 |
![]() | {{Formatnum|100.010|en|prec=2}} | Template:Formatnum/old | 100.01 |
Text | Expected | Actual | |
---|---|---|---|
Comparing Formatnum with Formatnum/old: "Expected" means using Formatnum/old | |||
![]() | {{Formatnum|.10,00|en}} | Template:Formatnum/old | .10,00 |
![]() | {{Formatnum|.10,00|en|sep=}} | Template:Formatnum/old | .10,00 |
![]() | {{Formatnum|100,0.|en}} | Template:Formatnum/old | 100,0. |
![]() | {{Formatnum|100,0.|en|sep=}} | Template:Formatnum/old | 100,0. |
![]() | {{Formatnum|100.01|en|prec=-2}} | Template:Formatnum/old | 100.01 |
![]() | {{Formatnum|200.1|en|prec=3.5}} | Template:Formatnum/old | 200.100 |
![]() | {{Formatnum|200.1|en|prec=3,5}} | 200.1 | 200.1 |
![]() | {{Formatnum|200.1|en|prec=a}} | 200.1 | 200.1 |
Text | Expected | Actual | |
---|---|---|---|
![]() | {{Formatnum|-0|en}} | 0 | 0 |
![]() | {{Formatnum|+123|en}} | 123 | 123 |
Text | Expected | Actual | |
---|---|---|---|
![]() | {{Formatnum|12:34:45|en}} | 12:34:45 | 12:34:45 |
![]() | {{Formatnum|12 h 34|fr}} | 12 h 34 | 12 h 34 |
![]() | {{Formatnum|12:34:45|th}} | 12:34:45 | 12:34:45 |
![]() | {{Formatnum|12:34:45.00|en}} | 12:34:45.00 | 12:34:45.00 |
![]() | {{Formatnum|12°34′45.00″|en}} | 12°34′45.00″ | 12°34′45.00″ |
![]() | {{Formatnum|some words...|en}} | some words... | some words... |
Text | Expected | Actual | |
---|---|---|---|
The choice of decimal system may vary in Malayalam, Sinhalese, Mongolian and Uyghur languages. Using an explicit script extension to the language code should disambiguate this, but this still does not work. In these languages, differences will not be counted as test failures. | |||
![]() | {{Formatnum|450|en}} | 450 | 450 |
![]() | {{Formatnum|450|as}} | ৪৫০ | ৪৫০ |
![]() | {{Formatnum|450|bn}} | ৪৫০ | ৪৫০ |
![]() | {{Formatnum|450|gu}} | ૪૫૦ | ૪૫૦ |
![]() | {{Formatnum|450|hi}} | ४५० | ४५० |
![]() | {{Formatnum|450|kn}} | ೪೫೦ | ೪೫೦ |
![]() | {{Formatnum|450|ml-Latn}} | 450 | 450 |
![]() | {{Formatnum|450|ml}} | 450 | 450 |
![]() | {{Formatnum|450|ml-Mlym}} | ൪൫൦ | 450 |
![]() | {{Formatnum|450|or}} | ୪୫୦ | ୪୫୦ |
![]() | {{Formatnum|450|si-Latn}} | 450 | 450 |
![]() | {{Formatnum|450|si}} | 450 | 450 |
![]() | {{Formatnum|450|si-Sinh}} | ෪෫෦ | 450 |
![]() | {{Formatnum|450|ta}} | ௪௫௦ | ௪௫௦ |
![]() | {{Formatnum|450|te}} | ౪౫౦ | ౪౫౦ |
![]() | {{Formatnum|450|bo}} | ༤༥༠ | ༤༥༠ |
![]() | {{Formatnum|450|dz}} | ༤༥༠ | ༤༥༠ |
![]() | {{Formatnum|450|mn-Tibt}} | ༤༥༠ | 450 |
![]() | {{Formatnum|450|mn-Mong}} | ᠔᠕᠐ | 450 |
![]() | {{Formatnum|450|mn}} | ᠔᠕᠐ | ᠔᠕᠐ |
![]() | {{Formatnum|450|mn-Cyrl}} | 450 | 450 |
![]() | {{Formatnum|450|th}} | ๔๕๐ | ๔๕๐ |
![]() | {{Formatnum|450|km}} | ៤៥០ | ៤៥០ |
![]() | {{Formatnum|450|lo}} | ໔໕໐ | ໔໕໐ |
![]() | {{Formatnum|450|ar}} | ٤٥٠ | ٤٥٠ |
![]() | {{Formatnum|450|fa}} | ۴۵۰ | ۴۵۰ |
![]() | {{Formatnum|450|ps}} | ۴۵۰ | ۴۵۰ |
![]() | {{Formatnum|450|ks}} | ۴۵۰ | ۴۵۰ |
![]() | {{Formatnum|450|ug-Cyrl}} | 450 | 450 |
![]() | {{Formatnum|450|ug-Latn}} | 450 | 450 |
![]() | {{Formatnum|450|ug}} | 450 | 450 |
![]() | {{Formatnum|450|ug-Arab}} | ۴۵۰ | 450 |
Text | Expected | Actual | |
---|---|---|---|
Basic cases generating a decimal separator appropriate to each language | |||
![]() | {{Formatnum|123.45|de}} | 123,45 | 123,45 |
![]() | {{Formatnum|123.45|en}} | 123.45 | 123.45 |
![]() | {{Formatnum|123.45|fr}} | 123,45 | 123,45 |
![]() | {{Formatnum|123.45|sv}} | 123,45 | 123,45 |
There should be no trailing decimal separator for integer values | |||
![]() | {{Formatnum|123.|en}} | 123 | 123 |
![]() | {{Formatnum|123.|fr}} | 123 | 123 |
![]() | {{Formatnum|123.00|en}} | 123 | 123 |
![]() | {{Formatnum|123.00|fr}} | 123 | 123 |
There should be at least a leading zero before the decimal separator for small non-zero absolute values | |||
![]() | {{Formatnum|.12345|en}} | 0.12345 | 0.12345 |
![]() | {{Formatnum|.12345|fr}} | 0,12345 | 0,12345 |
![]() | {{Formatnum|-.12345|en}} | −0.12345 | −0.12345 |
![]() | {{Formatnum|-.12345|fr}} | −0,12345 | −0,12345 |
Text | Expected | Actual | |
---|---|---|---|
There should be grouping separators appropriate to each language | |||
![]() | {{Formatnum|123456789|de}} | 123.456.789 | 123.456.789 |
![]() | {{Formatnum|123456789|en}} | 123,456,789 | 123,456,789 |
![]() | {{Formatnum|123456789|ml}} | 12,34,56,789 | 12,34,56,789 |
Below there should be no grouping separators in any language | |||
![]() | {{Formatnum|123456789|de|sep=1}} | 123456789 | 123456789 |
![]() | {{Formatnum|123456789|en|sep=1}} | 123456789 | 123456789 |
![]() | {{Formatnum|123456789|fr|sep=1}} | 123456789 | 123456789 |
![]() | {{Formatnum|123456789|ml|sep=1}} | 123456789 | 123456789 |
Text | Expected | Actual | |
---|---|---|---|
Comparing Formatnum with Formatnum/old: "Expected" means using Formatnum/old. Actual and expected results are HTMLized in wikitext source format. Differences will not be counted as test failures. | |||
![]() | {{Formatnum|123456789|en}} | Template:Formatnum/old | 123,456,789 |
![]() | {{Formatnum|123456789|fr}} | Template:Formatnum/old | 123 456 789 |
![]() | {{Formatnum|123456789|br}} | Template:Formatnum/old | 123 456 789 |
![]() | {{Formatnum|123456789|co}} | Template:Formatnum/old | 123 456 789 |
![]() | {{Formatnum|123456789|oc}} | Template:Formatnum/old | 123 456 789 |
![]() | {{Formatnum|123456789|ty}} | Template:Formatnum/old | 123 456 789 |
![]() | {{Formatnum|123456789|pl}} | Template:Formatnum/old | 123 456 789 |
Text | Expected | Actual | |
---|---|---|---|
Actual and expected results are HTMLized in wikitext source format. | |||
![]() | {{Formatnum|12345|en}} | 12,345 | 12,345 |
![]() | {{Formatnum/old|12345|en}} | 12,345 | Template:Formatnum/old |
Grouping separators may be non-breaking spaces (preferably narrow), they have several HTML representations. Possible differences below will not be counted as failures. | |||
![]() | {{Formatnum|12345|fr}} | 12 345 | 12 345 |
![]() | {{Formatnum/old|12345|fr}} | 12 345 | Template:Formatnum/old |
![]() | {{Formatnum|12345|pl}} | 12 345 | 12 345 |
![]() | {{Formatnum/old|12345|pl}} | 12 345 | Template:Formatnum/old |
Text | Expected | Actual | |
---|---|---|---|
Comparing Formatnum with Formatnum/old: "Expected" means using Formatnum/old. Actual and expected results are HTMLized in wikitext source format. Differences will not be counted as test failures. | |||
![]() | {{Formatnum|1234567890|en}} | Template:Formatnum/old | 1,234,567,890 |
![]() | {{Formatnum|1234567890|ru}} | Template:Formatnum/old | 1 234 567 890 |
![]() | {{Formatnum|1234567890|hy}} | Template:Formatnum/old | 1 234 567 890 |
![]() | {{Formatnum|1234567890|ka}} | Template:Formatnum/old | 1 234 567 890 |
![]() | {{Formatnum|1234567890|mn}} | Template:Formatnum/old | ᠑,᠒᠓᠔,᠕᠖᠗,᠘᠙᠐ |
![]() | {{Formatnum|1234567890|as}} | Template:Formatnum/old | ১,২৩,৪৫,৬৭,৮৯০ |
![]() | {{Formatnum|1234567890|bn}} | Template:Formatnum/old | ১,২৩,৪৫,৬৭,৮৯০ |
![]() | {{Formatnum|1234567890|gu}} | Template:Formatnum/old | ૧,૨૩,૪૫,૬૭,૮૯૦ |
![]() | {{Formatnum|1234567890|hi}} | Template:Formatnum/old | १,२३,४५,६७,८९० |
![]() | {{Formatnum|1234567890|kn}} | Template:Formatnum/old | ೧,೨೩,೪೫,೬೭,೮೯೦ |
![]() | {{Formatnum|1234567890|ml}} | Template:Formatnum/old | 1,23,45,67,890 |
![]() | {{Formatnum|1234567890|or}} | Template:Formatnum/old | ୧,୨୩,୪୫,୬୭,୮୯୦ |
![]() | {{Formatnum|1234567890|pa}} | Template:Formatnum/old | 1,23,45,67,890 |
![]() | {{Formatnum|1234567890|ta}} | Template:Formatnum/old | ௧,௨௩,௪௫,௬௭,௮௯௦ |
![]() | {{Formatnum|1234567890|te}} | Template:Formatnum/old | ౧,౨౩,౪౫,౬౭,౮౯౦ |
![]() | {{Formatnum|1234567890|bo}} | Template:Formatnum/old | ༡,༢༣༤,༥༦༧,༨༩༠ |
![]() | {{Formatnum|1234567890|th}} | Template:Formatnum/old | ๑,๒๓๔,๕๖๗,๘๙๐ |
![]() | {{Formatnum|1234567890|km}} | Template:Formatnum/old | ១២៣៤៥៦៧៨៩០ |
![]() | {{Formatnum|1234567890|lo}} | Template:Formatnum/old | ໑.໒໓໔.໕໖໗.໘໙໐ |
![]() | {{Formatnum|1234567890|ja}} | Template:Formatnum/old | 1,234,567,890 |
![]() | {{Formatnum|1234567890|ko}} | Template:Formatnum/old | 1,234,567,890 |
![]() | {{Formatnum|1234567890|zh}} | Template:Formatnum/old | 1,234,567,890 |
![]() | {{Formatnum|1234567890|zh-hans}} | Template:Formatnum/old | 1,234,567,890 |
![]() | {{Formatnum|1234567890|zh-hant}} | Template:Formatnum/old | 1,234,567,890 |
![]() | {{Formatnum|1234567890|wuu}} | Template:Formatnum/old | 1,234,567,890 |
![]() | {{Formatnum|1234567890|yue}} | Template:Formatnum/old | 1,234,567,890 |
![]() | {{Formatnum|1234567890|he}} | Template:Formatnum/old | 1,234,567,890 |
![]() | {{Formatnum|1234567890|yi}} | Template:Formatnum/old | 1,234,567,890 |
The Arabic script normally uses its own grouping separator U+066C (not to be confused with U+066B for its decimal separator). It also uses two different styles of digits: Western digits for standard Arabic and related languages in Africa, and Eastern digits for Farsi and related languages in Central Asia. In India or China, Latin-Arabic digits may be used with the ASCII comma U+0044 for the grouping separator. | |||
![]() | {{Formatnum|1234567890|ar}} | Template:Formatnum/old | ١٬٢٣٤٬٥٦٧٬٨٩٠ |
![]() | {{Formatnum|1234567890|fa}} | Template:Formatnum/old | ۱٬۲۳۴٬۵۶۷٬۸۹۰ |
![]() | {{Formatnum|1234567890|ps}} | Template:Formatnum/old | ۱٬۲۳۴٬۵۶۷٬۸۹۰ |
![]() | {{Formatnum|1234567890|ks}} | Template:Formatnum/old | ۱٬۲۳۴٬۵۶۷٬۸۹۰ |
![]() | {{Formatnum|1234567890|ur}} | Template:Formatnum/old | 1,234,567,890 |
![]() | {{Formatnum|1234567890|ug}} | Template:Formatnum/old | 1,234,567,890 |
Text | Expected | Actual | |
---|---|---|---|
Results may vary depending on supported language of the user if it uses non-ASCII digits. Differences will not be counted as test failures. | |||
![]() | {{Formatnum|100000|sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000||sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000|qq|sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000|qqa|sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000|mul|sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000|und|sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000|root|sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000|user|sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000|invalid|sep=1}} | 100000 | 100000 |
If too many languages are used (more than 20?), they may behave like default languages. Differences will not be counted as test failures. | |||
![]() | {{Formatnum|100000|aa|sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000|ab|sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000|ace|sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000|mwl|sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000|ydd|sep=1}} | 100000 | 100000 |
![]() | {{Formatnum|100000|zea|sep=1}} | 100000 | 100000 |