Module talk:Formatnum/testcases

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

9 tests failed.

test_1_English_basic
Text Expected Actual
✓ {{Formatnum|0|en}} 0 0
✓ {{Formatnum|-123|en}} -123 -123
test_2_unnecessary_signs
Text Expected Actual
✓ {{Formatnum|-0|en}} 0 0
✓ {{Formatnum|+123|en}} 123 123
test_3_non_numbers_preserved
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...
test_4_English_precision_rounding
Text Expected Actual
✓ {{Formatnum|100|en|prec=1}} 100.0 100.0
✓ {{Formatnum|100.0|en|prec=1}} 100.0 100.0
✓ {{Formatnum|100.01|en|prec=2}} 100.01 100.01
✓ {{Formatnum|100.01|en|prec=3}} 100.010 100.010
✓ {{Formatnum|100.010|en|prec=2}} 100.01 100.01
test_5_English_bad_parameters
Text Expected Actual
✓ {{Formatnum|.10,00|en}} .10,00 .10,00
✓ {{Formatnum|.10,00|en|sep=}} .10,00 .10,00
✓ {{Formatnum|100,0.|en}} 100,0. 100,0.
✓ {{Formatnum|100,0.|en|sep=}} 100,0. 100,0.
✓ {{Formatnum|100.01|en|prec=-2}} 100.01 100.01
✓ {{Formatnum|200.1|en|prec=3.5}} 200.100 200.100
✓ {{Formatnum|200.1|en|prec=3,5}} 200.1 200.1
✓ {{Formatnum|200.1|en|prec=a}} 200.1 200.1
test_6_decimal_separator
Text Expected Actual
✓ {{Formatnum|.12345|en}} 0.12345 0.12345
✓ {{Formatnum|.12345|fr}} 0,12345 0,12345
✓ {{Formatnum|123.45|en}} 123.45 123.45
✓ {{Formatnum|123.45|fr}} 123,45 123,45
✓ {{Formatnum|123.|en}} 123 123
✓ {{Formatnum|123.|fr}} 123 123
✓ {{Formatnum|123.00|en}} 123 123
✓ {{Formatnum|123.00|fr}} 123 123
✓ {{Formatnum|1001|de}} 1.001 1.001
✓ {{Formatnum|1001|pl}} 1001 1001
✓ {{Formatnum|1001|en}} 1,001 1,001
test_7_no_grouping_separators
Text Expected Actual
✓ {{Formatnum|100000|en|sep=1}} 100000 100000
✓ {{Formatnum|100000|fr|sep=1}} 100000 100000
test_8_HTML_entity_or_native_UTF8
Text Expected Actual
✓ {{Formatnum|12345|en}} 12,345 12,345
✓ {{Formatnum/old|12345|en}} 12,345 12,345
✓ {{Formatnum|12345|fr}} 12 345 12 345
✓ {{Formatnum/old|12345|fr}} 12 345 12 345
✓ {{Formatnum|12345|en}} 12,345 12,345
N {{Formatnum|12345|fr}} 12 345 12 345
N {{Formatnum|12345|br}} 12,345 12 345
N {{Formatnum|12345|co}} 12,345 12 345
N {{Formatnum|12345|oc}} 12,345 12 345
N {{Formatnum|12345|ty}} 12,345 12 345
test_9_grouping_separators
Text Expected Actual
✓ {{Formatnum|1234567890|en}} 1,234,567,890 1,234,567,890
✓ {{Formatnum|1234567890|ka}} 1,234,567,890 1,234,567,890
✓ {{Formatnum|1234567890|mn}} ᠑,᠒᠓᠔,᠕᠖᠗,᠘᠙᠐ ᠑,᠒᠓᠔,᠕᠖᠗,᠘᠙᠐
N {{Formatnum|1234567890|ar}} ۱,۲۳۴,۵۶۷,۸۹۰ ١٬٢٣٤٬٥٦٧٬٨٩٠
✓ {{Formatnum|1234567890|fa}} ۱٬۲۳۴٬۵۶۷٬۸۹۰ ۱٬۲۳۴٬۵۶۷٬۸۹۰
✓ {{Formatnum|1234567890|ks}} ١٬٢٣٤٬٥٦٧٬٨٩٠ ١٬٢٣٤٬٥٦٧٬٨٩٠
✓ {{Formatnum|1234567890|hi}} १,२३,४५,६७,८९० १,२३,४५,६७,८९०
✓ {{Formatnum|1234567890|bn}} ১,২৩,৪৫,৬৭,৮৯০ ১,২৩,৪৫,৬৭,৮৯০
N {{Formatnum|1234567890|ta}} 1,23,45,67,890 ௧,௨௩,௪௫,௬௭,௮௯௦
✓ {{Formatnum|1234567890|te}} ౧,౨౩,౪౫,౬౭,౮౯౦ ౧,౨౩,౪౫,౬౭,౮౯౦
✓ {{Formatnum|1234567890|kn}} ೧,೨೩,೪೫,೬೭,೮೯೦ ೧,೨೩,೪೫,೬೭,೮೯೦
✓ {{Formatnum|1234567890|or}} ୧,୨୩,୪୫,୬୭,୮୯୦ ୧,୨୩,୪୫,୬୭,୮୯୦
N {{Formatnum|1234567890|gu}} 1,23,45,67,890 ૧,૨૩,૪૫,૬૭,૮૯૦
✓ {{Formatnum|1234567890|pa}} 1,23,45,67,890 1,23,45,67,890
✓ {{Formatnum|1234567890|bo}} ༡,༢༣༤,༥༦༧,༨༩༠ ༡,༢༣༤,༥༦༧,༨༩༠
✓ {{Formatnum|1234567890|th}} ๑,๒๓๔,๕๖๗,๘๙๐ ๑,๒๓๔,๕๖๗,๘๙๐
N {{Formatnum|1234567890|km}} 1,234,567,890 ១២៣៤៥៦៧៨៩០
✓ {{Formatnum|1234567890|lo}} ໑,໒໓໔,໕໖໗,໘໙໐ ໑,໒໓໔,໕໖໗,໘໙໐
test_Error_more_than_20_languages
Text Expected Actual
✓ {{Formatnum|100000|ab|sep=1}} 100000 100000
✓ {{Formatnum|100000|ace|sep=1}} 100000 100000
test_Unsupported_languages_using_user_default_language_instead_may_fail
Text Expected Actual
✓ {{Formatnum|100000||sep=1}} 100000 100000
✓ {{Formatnum|100000|aa|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