Jump to content

Module talk:Formatnum/testcases

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

12 of 75 tests failed.

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

Start a discussion about improving the Module:Formatnum/testcases page

Start a discussion