คุยเรื่องมอดูล:ConvertNumeric/testcases

ไม่รองรับเนื้อหาของหน้าในภาษาอื่น
จากวิกิพีเดีย สารานุกรมเสรี

All tests passed.

test_decToHex
ข้อความ คาดหวัง เป็นจริง
checkY {{#invoke:ConvertNumeric|decToHex|10 20 40 1024 78912345|minlength=4}} 000A 0014 0028 0400 4B41B59 000A 0014 0028 0400 4B41B59
test_numeral_to_english
ข้อความ คาดหวัง เป็นจริง
checkY {{#invoke:ConvertNumeric | numeral_to_english |0}} zero zero
checkY {{#invoke:ConvertNumeric | numeral_to_english |1}} one one
checkY {{#invoke:ConvertNumeric | numeral_to_english | 1 }} one one
checkY {{#invoke:ConvertNumeric | numeral_to_english |1 | case=u}} One One
checkY {{#invoke:ConvertNumeric | numeral_to_english |1 | case=U}} One One
checkY {{#invoke:ConvertNumeric | numeral_to_english |-1}} negative one negative one
checkY {{#invoke:ConvertNumeric | numeral_to_english |-1 | negative=minus}} minus one minus one
checkY {{#invoke:ConvertNumeric | numeral_to_english |70}} seventy seventy
checkY {{#invoke:ConvertNumeric | numeral_to_english |42}} forty-two forty-two
checkY {{#invoke:ConvertNumeric | numeral_to_english |123}} one hundred and twenty-three one hundred and twenty-three
checkY {{#invoke:ConvertNumeric | numeral_to_english |123 | sp=us}} one hundred twenty-three one hundred twenty-three
checkY {{#invoke:ConvertNumeric | numeral_to_english |123 | adj=on}} one-hundred-and-twenty-three one-hundred-and-twenty-three
checkY {{#invoke:ConvertNumeric | numeral_to_english |1050}} one thousand and fifty one thousand and fifty
checkY {{#invoke:ConvertNumeric | numeral_to_english |1050 | sp=us}} one thousand fifty one thousand fifty
checkY {{#invoke:ConvertNumeric | numeral_to_english |0.25}} zero point two five zero point two five
checkY {{#invoke:ConvertNumeric | numeral_to_english |.25}} zero point two five zero point two five
checkY {{#invoke:ConvertNumeric | numeral_to_english |0 | ord=on}} zeroth zeroth
checkY {{#invoke:ConvertNumeric | numeral_to_english |33 | ord=on}} thirty-third thirty-third
checkY {{#invoke:ConvertNumeric | numeral_to_english |40 | ord=on}} fortieth fortieth
checkY {{#invoke:ConvertNumeric | numeral_to_english |5000000000 | ord=on}} five billionth five billionth
checkY {{#invoke:ConvertNumeric | numeral_to_english |0 | pl=on}} zeros zeros
checkY {{#invoke:ConvertNumeric | numeral_to_english |76 | pl=on}} seventy-sixes seventy-sixes
checkY {{#invoke:ConvertNumeric | numeral_to_english |1000000000000000000000000000001}} one nonillion and one one nonillion and one
checkY {{#invoke:ConvertNumeric | numeral_to_english |1.23E3}} one thousand two hundred and thirty one thousand two hundred and thirty
checkY {{#invoke:ConvertNumeric | numeral_to_english |123E-4}} zero point zero one two three zero point zero one two three
checkY {{#invoke:ConvertNumeric | numeral_to_english |1001001001001000 | lk=on}} one quadrillion one trillion one billion one million one thousand one quadrillion one trillion one billion one million one thousand
checkY {{#invoke:ConvertNumeric | numeral_to_english |1001001001001000 | lk=billion,quadrillion}} one quadrillion one trillion one billion one million one thousand one quadrillion one trillion one billion one million one thousand
checkY {{#invoke:ConvertNumeric | numeral_to_english |5E30}} five nonillion five nonillion
checkY {{#invoke:ConvertNumeric | numeral_to_english |-123456789.25}} negative one hundred twenty-three million four hundred fifty-six thousand seven hundred and eighty-nine point two five negative one hundred twenty-three million four hundred fifty-six thousand seven hundred and eighty-nine point two five
checkY {{#invoke:ConvertNumeric | numeral_to_english |0 | zero=foo}} foo foo
checkY {{#invoke:ConvertNumeric | numeral_to_english |0 | ord=on | zero=none}} none none
checkY {{#invoke:ConvertNumeric | numeral_to_english |1 | numerator=2 | denominator=3}} one and two-thirds one and two-thirds
checkY {{#invoke:ConvertNumeric | numeral_to_english || numerator=2 | denominator=3}} two-thirds two-thirds
checkY {{#invoke:ConvertNumeric | numeral_to_english |1 | denominator=2}} one and a half one and a half
checkY {{#invoke:ConvertNumeric | numeral_to_english |1 | numerator=3 | denominator=2}} one and three-halves one and three-halves
checkY {{#invoke:ConvertNumeric | numeral_to_english |1 | numerator=1 | denominator=4}} one and a quarter one and a quarter
checkY {{#invoke:ConvertNumeric | numeral_to_english |1 | numerator=1 | denominator=4 | sp=us}} one and a fourth one and a fourth
checkY {{#invoke:ConvertNumeric | numeral_to_english |1 | numerator=1 | denominator=4 | one=one}} one and one-quarter one and one-quarter
checkY {{#invoke:ConvertNumeric | numeral_to_english |1 | numerator=1 | denominator=4 | sp=us | one=one}} one and one-fourth one and one-fourth
checkY {{#invoke:ConvertNumeric | numeral_to_english |9 | numerator=3 | denominator=4}} nine and three-quarters nine and three-quarters
checkY {{#invoke:ConvertNumeric | numeral_to_english |9 | numerator=3 | denominator=4 | sp=us}} nine and three-fourths nine and three-fourths
checkY {{#invoke:ConvertNumeric | numeral_to_english |23 | numerator=12 | denominator=16}} twenty-three and twelve-sixteenths twenty-three and twelve-sixteenths
test_numeral_to_english_error
ข้อความ คาดหวัง เป็นจริง
checkY {{#invoke:ConvertNumeric | numeral_to_english |}} Invalid decimal numeral Invalid decimal numeral
checkY {{#invoke:ConvertNumeric | numeral_to_english |a}} Invalid decimal numeral Invalid decimal numeral
checkY {{#invoke:ConvertNumeric | numeral_to_english |.}} Invalid decimal numeral Invalid decimal numeral
checkY {{#invoke:ConvertNumeric | numeral_to_english |e}} Invalid decimal numeral Invalid decimal numeral
checkY {{#invoke:ConvertNumeric | numeral_to_english |E}} Invalid decimal numeral Invalid decimal numeral
checkY {{#invoke:ConvertNumeric | numeral_to_english |E1}} Invalid decimal numeral Invalid decimal numeral
checkY {{#invoke:ConvertNumeric | numeral_to_english |.E1}} Invalid decimal numeral Invalid decimal numeral
checkY {{#invoke:ConvertNumeric | numeral_to_english |+}} Invalid decimal numeral Invalid decimal numeral
checkY {{#invoke:ConvertNumeric | numeral_to_english |-}} Invalid decimal numeral Invalid decimal numeral
checkY {{#invoke:ConvertNumeric | numeral_to_english |123a}} Invalid decimal numeral Invalid decimal numeral
checkY {{#invoke:ConvertNumeric | numeral_to_english |a123}} Invalid decimal numeral Invalid decimal numeral
checkY {{#invoke:ConvertNumeric | numeral_to_english |0.1a}} Invalid decimal numeral Invalid decimal numeral
checkY {{#invoke:ConvertNumeric | numeral_to_english |-a123}} Invalid decimal numeral Invalid decimal numeral
test_numeral_to_english_round
ข้อความ คาดหวัง เป็นจริง
checkY {{#invoke:ConvertNumeric | numeral_to_english |1 | round=on}} one one
checkY {{#invoke:ConvertNumeric | numeral_to_english |37 | round=on}} thirty-seven thirty-seven
checkY {{#invoke:ConvertNumeric | numeral_to_english |190 | round=on}} two hundred two hundred
checkY {{#invoke:ConvertNumeric | numeral_to_english |110 | round=up}} two hundred two hundred
checkY {{#invoke:ConvertNumeric | numeral_to_english |190 | round=down}} one hundred one hundred
checkY {{#invoke:ConvertNumeric | numeral_to_english |87654321 | round=on}} ninety million ninety million
checkY {{#invoke:ConvertNumeric | numeral_to_english |12345678 | round=on}} twelve million twelve million
checkY {{#invoke:ConvertNumeric | numeral_to_english |-190 | round=on}} negative two hundred negative two hundred
checkY {{#invoke:ConvertNumeric | numeral_to_english |-190 | round=up}} negative one hundred negative one hundred
checkY {{#invoke:ConvertNumeric | numeral_to_english |-110 | round=down}} negative two hundred negative two hundred
checkY {{#invoke:ConvertNumeric | numeral_to_english |0.25 | round=on}} zero zero
checkY {{#invoke:ConvertNumeric | numeral_to_english |0.5 | round=on}} one one
checkY {{#invoke:ConvertNumeric | numeral_to_english |-0.25 | round=on}} zero zero
checkY {{#invoke:ConvertNumeric | numeral_to_english |-0.5 | round=on}} negative one negative one
checkY {{#invoke:ConvertNumeric | numeral_to_english |0.01 | round=up}} one one
checkY {{#invoke:ConvertNumeric | numeral_to_english |0.99 | round=down}} zero zero
checkY {{#invoke:ConvertNumeric | numeral_to_english |-0.01 | round=down}} negative one negative one
checkY {{#invoke:ConvertNumeric | numeral_to_english |-0.99 | round=up}} zero zero
test_numeral_to_thai
ข้อความ คาดหวัง เป็นจริง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |0}} ศูนย์ ศูนย์
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1}} หนึ่ง หนึ่ง
checkY {{#invoke:ConvertNumeric | numeral_to_thai | 1 }} หนึ่ง หนึ่ง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1 | case=u}} หนึ่ง หนึ่ง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1 | case=U}} หนึ่ง หนึ่ง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |-1}} ลบหนึ่ง ลบหนึ่ง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |-1 | negative=อัน}} อันหนึ่ง อันหนึ่ง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |-1 | negative=ติดลบ}} ติดลบหนึ่ง ติดลบหนึ่ง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |70}} เจ็ดสิบ เจ็ดสิบ
checkY {{#invoke:ConvertNumeric | numeral_to_thai |42}} สี่สิบสอง สี่สิบสอง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |61}} หกสิบเอ็ด หกสิบเอ็ด
checkY {{#invoke:ConvertNumeric | numeral_to_thai |101}} หนึ่งร้อยเอ็ด หนึ่งร้อยเอ็ด
checkY {{#invoke:ConvertNumeric | numeral_to_thai |123}} หนึ่งร้อยยี่สิบสาม หนึ่งร้อยยี่สิบสาม
checkY {{#invoke:ConvertNumeric | numeral_to_thai |123 | sp=us}} หนึ่งร้อยยี่สิบสาม หนึ่งร้อยยี่สิบสาม
checkY {{#invoke:ConvertNumeric | numeral_to_thai |123 | adj=on}} หนึ่งร้อยยี่สิบสาม หนึ่งร้อยยี่สิบสาม
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1050}} หนึ่งพันห้าสิบ หนึ่งพันห้าสิบ
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1050 | sp=us}} หนึ่งพันห้าสิบ หนึ่งพันห้าสิบ
checkY {{#invoke:ConvertNumeric | numeral_to_thai |0.25}} ศูนย์จุดสองห้า ศูนย์จุดสองห้า
checkY {{#invoke:ConvertNumeric | numeral_to_thai |.25}} ศูนย์จุดสองห้า ศูนย์จุดสองห้า
checkY {{#invoke:ConvertNumeric | numeral_to_thai |0 | ord=on}} ศูนย์ ศูนย์
checkY {{#invoke:ConvertNumeric | numeral_to_thai |33 | ord=on}} สามสิบสาม สามสิบสาม
checkY {{#invoke:ConvertNumeric | numeral_to_thai |40 | ord=on}} สี่สิบ สี่สิบ
checkY {{#invoke:ConvertNumeric | numeral_to_thai |5000000000 | ord=on}} ห้าพันล้าน ห้าพันล้าน
checkY {{#invoke:ConvertNumeric | numeral_to_thai |0 | pl=on}} ศูนย์ ศูนย์
checkY {{#invoke:ConvertNumeric | numeral_to_thai |76 | pl=on}} เจ็ดสิบหก เจ็ดสิบหก
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1000000000000000000000000000001}} หนึ่งล้านล้านล้านล้านล้านเอ็ด หนึ่งล้านล้านล้านล้านล้านเอ็ด
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1.23E3}} หนึ่งพันสองร้อยสามสิบ หนึ่งพันสองร้อยสามสิบ
checkY {{#invoke:ConvertNumeric | numeral_to_thai |123E-4}} ศูนย์จุดศูนย์หนึ่งสองสาม ศูนย์จุดศูนย์หนึ่งสองสาม
checkY {{#invoke:ConvertNumeric | numeral_to_thai |5E30}} ห้าล้านล้านล้านล้านล้าน ห้าล้านล้านล้านล้านล้าน
checkY {{#invoke:ConvertNumeric | numeral_to_thai |-123456789.25}} ลบหนึ่งร้อยยี่สิบสามล้านสี่แสนห้าหมื่นหกพันเจ็ดร้อยแปดสิบเก้าจุดสองห้า ลบหนึ่งร้อยยี่สิบสามล้านสี่แสนห้าหมื่นหกพันเจ็ดร้อยแปดสิบเก้าจุดสองห้า
checkY {{#invoke:ConvertNumeric | numeral_to_thai |0 | zero=foo}} foo foo
checkY {{#invoke:ConvertNumeric | numeral_to_thai |0 | zero=}}
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1 | numerator=2 | denominator=3}} หนึ่งเศษสองส่วนสาม หนึ่งเศษสองส่วนสาม
checkY {{#invoke:ConvertNumeric | numeral_to_thai || numerator=2 | denominator=3}} เศษสองส่วนสาม เศษสองส่วนสาม
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1 | denominator=2}} หนึ่งเศษหนึ่งส่วนสอง หนึ่งเศษหนึ่งส่วนสอง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1 | numerator=3 | denominator=2}} หนึ่งเศษสามส่วนสอง หนึ่งเศษสามส่วนสอง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1 | numerator=1 | denominator=4}} หนึ่งเศษหนึ่งส่วนสี่ หนึ่งเศษหนึ่งส่วนสี่
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1 | numerator=1 | denominator=4 | one=หนึ่ง}} หนึ่งเศษหนึ่งส่วนสี่ หนึ่งเศษหนึ่งส่วนสี่
checkY {{#invoke:ConvertNumeric | numeral_to_thai |9 | numerator=3 | denominator=4}} เก้าเศษสามส่วนสี่ เก้าเศษสามส่วนสี่
test_numeral_to_thai_round
ข้อความ คาดหวัง เป็นจริง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |1 | round=on}} หนึ่ง หนึ่ง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |37 | round=on}} สามสิบเจ็ด สามสิบเจ็ด
checkY {{#invoke:ConvertNumeric | numeral_to_thai |190 | round=on}} สองร้อย สองร้อย
checkY {{#invoke:ConvertNumeric | numeral_to_thai |110 | round=up}} สองร้อย สองร้อย
checkY {{#invoke:ConvertNumeric | numeral_to_thai |190 | round=down}} หนึ่งร้อย หนึ่งร้อย
checkY {{#invoke:ConvertNumeric | numeral_to_thai |87654321 | round=on}} เก้าสิบล้าน เก้าสิบล้าน
checkY {{#invoke:ConvertNumeric | numeral_to_thai |12345678 | round=on}} สิบสองล้าน สิบสองล้าน
checkY {{#invoke:ConvertNumeric | numeral_to_thai |-190 | round=on}} ลบสองร้อย ลบสองร้อย
checkY {{#invoke:ConvertNumeric | numeral_to_thai |-190 | round=up}} ลบหนึ่งร้อย ลบหนึ่งร้อย
checkY {{#invoke:ConvertNumeric | numeral_to_thai |-110 | round=down}} ลบสองร้อย ลบสองร้อย
checkY {{#invoke:ConvertNumeric | numeral_to_thai |0.25 | round=on}} ศูนย์ ศูนย์
checkY {{#invoke:ConvertNumeric | numeral_to_thai |0.5 | round=on}} หนึ่ง หนึ่ง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |-0.25 | round=on}} ศูนย์ ศูนย์
checkY {{#invoke:ConvertNumeric | numeral_to_thai |-0.5 | round=on}} ลบหนึ่ง ลบหนึ่ง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |0.01 | round=up}} หนึ่ง หนึ่ง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |0.99 | round=down}} ศูนย์ ศูนย์
checkY {{#invoke:ConvertNumeric | numeral_to_thai |-0.01 | round=down}} ลบหนึ่ง ลบหนึ่ง
checkY {{#invoke:ConvertNumeric | numeral_to_thai |-0.99 | round=up}} ศูนย์ ศูนย์