Template:Val/test

From Wikipedia, the free encyclopedia

Here are some test to see if {{val}} works correctly:

{{val|1}} = 1
{{val|1|2}} = 1±2
{{val|1|(2)}} = 1(2)
{{val|1|2|-3}} = 1+2−3
{{val|1|e=1}} = 1×101
{{val|1|e=-1}} = 1×10−1
{{val|1|u=X}} = 1 X
{{val|h=Δ |12.34|f=%}} = Δ 12.34%
{{val|h=Δ |1245.6789|12345|-12345|e=12345|u=kg|f=%}} = Δ 1,245.6789+12,345−12,345×1012,345 kg%

Various ways of displaying units with and without links:

{{val|1|u=m/s}} = 1 m/s
{{val|1|u=m*s-1}} = 1 m·s-1
{{val|1|u=m|up=s}} = 1 m/s
{{val|1|ul=m/s}} = m/s
{{val|1|ul=m*s-1}} = m·s-1
{{val|1|ul=m|up=s}} = m/s
{{val|1|u=m|upl=s}} = 1 m/s
{{val|1|ul=m|upl=s}} = m/s

Grouping:

{{val|12}} = 12
{{val|123}} = 123
{{val|1234}} = 1,234
{{val|12345}} = 12,345
{{val|123456}} = 123,456
{{val|1234567}} = 1,234,567
{{val|12345678}} = 12,345,678
{{val|123456789}} = 123,456,789
{{val|1234567890}} = 1,234,567,890
{{val|1.2}} = 1.2
{{val|1.23}} = 1.23
{{val|1.234}} = 1.234
{{val|1.2345}} = 1.2345
{{val|1.23456}} = 1.23456
{{val|1.234567}} = 1.234567
{{val|1.2345678}} = 1.2345678
{{val|1.23456789}} = 1.23456789
{{val|1.234567890}} = 1.23456789

Formatting large numbers:

{{val|12345}} = 12,345
{{val|12345|12345}} = 12,345±12,345
{{val|12345|(12345)}} = 12,345(12345)
{{val|12345|12345|-12345}} = 12,345+12,345−12,345
{{val|12345|e=12345}} = 12,345×1012,345
{{val|12345|e=-12345}} = 12,345×10−12,345
{{val|12345|u=Non-existing unit}} = 12,345 Non-existing unit
{{val|h=header|12345|f=footer}} = header12,345footer

Errors:

{{val}} = Error in {{val}}: first argument is not a valid number or requires too much precision to display.
{{val|A|B|C}} = Error in {{val}}: first argument is not a valid number or requires too much precision to display.
{{val|1|B|C}} = Error in {{val}}: second argument is not a valid number or requires too much precision to display.
{{val|1|1|C}} = Error in {{val}}: third argument is not a valid number or requires too much precision to display.
{{val|1|1|1}} = Error in {{val}}: third argument is not negative.
{{val|1|e=A}} = Error in {{val}}: exponent (e) is not a valid number or requires too much precision to display.
{{val|1|up=s}} = Error in {{val}}: unit (u or ul) is not specified but units per (up or upl) is.
{{val|1|upl=s}} = Error in {{val}}: unit (u or ul) is not specified but units per (up or upl) is.
{{val|1|u=m|ul=m}} = Error in {{val}}: unit (u) and units with link (ul) are both specified, only one is allowed.
{{val|1|u=m|up=m|upl=m}} = Error in {{val}}: unit (u or ul) is not specified but units per (up or upl) is.
{{val|12345678901234567890}} = Error in {{val}}: first argument is not a valid number or requires too much precision to display.