Predloga:Val/testniprimeri

Iz Wikipedije, proste enciklopedije
Jump to navigation Jump to search

Osveži

The example commands in the first column show that a key factor is the number of numeric values given. They are the only three unnamed parameters 1, 2, and 3. Note how the named argument (with the equals sign) can intervene on the 1st, 2nd, and 3rd slots while the unnamed parameters can take on the 1st, 2nd or 3rd numbers given as arguments anywhere in the command. The other key factor is the named parameters that cause linking, with the U's and the L's in their names.


Testiranje fizikalnih enot[uredi kodo]

{{val|1|ul=m/s}}

Val: m/s
Peskovnik: m/s

DECIMALNE VEJICE[uredi kodo]

SL - {{val|123,45|+3,2|-45,3}}

Val: 123,45+3,2
−45,3
Peskovnik: 123,45+3,2
−45,3

sl - {{val|12345123|+3,2|-45,3}}

Val: 12345123+3,2
−45,3
Peskovnik: 12345123+3,2
−45,3

sl - {{val|,333|+3,2|-45,3}}

Val: ,333+3,2
−45,3
Peskovnik: ,333+3,2
−45,3

ANG - {{val|123.45|+3.2|-45.3}}

Val: 12345+32
−453
Peskovnik: 12345+32
−453

ANG - {{val|1345123|+3.2|-45.3}}

Val: 1345123+32
−453
Peskovnik: 1345123+32
−453

sl - {{val|.333|+3.2|-45.3}}

Val: 333+32
−453
Peskovnik: 333+32
−453
code {{val}} {{val/peskovnik}}

Basic tests[uredi kodo]

{{val}}
{{val|1}} 1 1
{{val|-1}} −1 −1
{{val|1|u=|up=}} 1 1
{{val|1|2}} 1±2 1±2
{{val|1|(2)}} 1(2) 1(2)
{{val|1|1|1}} 1+1
−1
1+1
−1
{{val|1|2|-3}} 1+2
−3
1+2
−3
{{val|1|+2|-3}} 1+2
−3
1+2
−3
{{val|12|+34|-5}} 12+34
−5
12+34
−5
{{val|12|+3|-45}} 12+3
−45
12+3
−45
{{val|0,123|+0,111|-0,999}} 0,123+0,111
−0,999
0,123+0,111
−0,999

Integer[uredi kodo]

{{val|0}} 0 0
{{val|0,00}} 0,00 0,00
{{val|1}} 1 1
{{val|1,00}} 1,00 1,00
{{val|1|1|-1}} 1+1
−1
1+1
−1
{{val|1,00|1,00|-1,00}} 1,00+1,00
−1,00
1,00+1,00
−1,00

Exponents[uredi kodo]

{{val|1|e=2}} 1×102 1×102
{{val|1|e=-2}} 1×10−2 1×10−2
{{val|1|2|e=3}} (1±2)×103 (1±2)×103
{{val|1|(2)|e=3}} 1(2)×103 1(2)×103
{{val|1|2|-3|e=4}} 1+2
−3
×104
1+2
−3
×104

Prefix/Suffix[uredi kodo]

{{val|p=Foo-|12,34|s=-bar}} Foo-12,34-bar Foo-12,34-bar
{{val|p=pre-|1,9|0,1|-0,5|e=-7|ul=kg|s=-suf}} pre-1,9+0,1
−0,5
×10−7 kg-suf
pre-1,9+0,1
−0,5
×10−7 kg-suf

Various ways of displaying units with/without links[uredi kodo]

{{val|1|u=Foo}} Foo Foo
{{val|1|ul=Foo}} Foo Foo
{{val|1|u=m/s}} 1 m/s 1 m/s
{{val|1|u=m.s-1}} 1 m⋅s−1 1 m⋅s−1
{{val|1|u=m|up=s}} 1 m/s 1 m/s
{{val|1|ul=m/s}} m/s m/s
{{val|1|ul=m.s-1}} m⋅s−1 m⋅s−1
{{val|1|ul=m|up=s}} m/s m/s
{{val|1|u=m|upl=s}} 1 m/s 1 m/s
{{val|1|ul=m|upl=s}} m/s m/s

Non-spaced units[uredi kodo]

{{val|1|u=deg}}
{{val|1|2|u=deg}} ± ±
{{val|1|(2)|u=deg}} 1(2)° 1(2)°
{{val|1|2|-3|u=deg}} +2°
−3°
+2°
−3°
{{val|1|2|e=3|ul=deg}} (1°±2°)×103 (1°±2°)×103
{{val|1|(2)|e=3|u=deg}} 1(2)°×103 1(2)°×103
{{val|1|2|-3|e=4|u=deg}} +2°
−3°
×104
+2°
−3°
×104
{{val|1|ul=%}} 1% 1%
{{val|1|2|ul=%}} 1%±2% 1%±2%
{{val|1|(2)|ul=%}} 1(2)% 1(2)%
{{val|1|2|-3|ul=%}} 1%+2%
−3%
1%+2%
−3%
{{val|1|2|e=3|ul=%}} (1%±2%)×103 (1%±2%)×103
{{val|1|(2)|e=3|ul=%}} 1(2)%×103 1(2)%×103
{{val|1|2|-3|e=4|ul=%}} 1%+2%
−3%
×104
1%+2%
−3%
×104

Per units[uredi kodo]

{{val|1|up=s}} 1/s 1/s
{{val|1|upl=s}} 1/s 1/s
{{val|1|u=m|up=s}} 1 m/s 1 m/s
{{val|1|u=kg|up=N.m}} 1 kg/(N·m) 1 kg/(N·m)
{{val|1|u=W|up=mg/ml}} Lua error in Modul:Convert at line 645: attempt to index field 'per_unit_fixups' (a nil value). Lua error in Modul:Convert at line 645: attempt to index field 'per_unit_fixups' (a nil value).
{{val|1|u=kW.h|up=s}} 1 (kW⋅h)/s 1 (kW⋅h)/s
{{val|1|u=kW.h|up=N.m}} 1 (kW⋅h)/(N·m) 1 (kW⋅h)/(N·m)
{{val|1|u=kW.h|up=mg/ml}} Lua error in Modul:Convert at line 645: attempt to index field 'per_unit_fixups' (a nil value). Lua error in Modul:Convert at line 645: attempt to index field 'per_unit_fixups' (a nil value).
{{val|1|u=km/h|up=s}} 1 (km/h)/s 1 (km/h)/s
{{val|1|u=km/h|up=N.m}} 1 (km/h)/(N·m) 1 (km/h)/(N·m)
{{val|1|u=km/h|up=mg/ml}} Lua error in Modul:Convert at line 645: attempt to index field 'per_unit_fixups' (a nil value). Lua error in Modul:Convert at line 645: attempt to index field 'per_unit_fixups' (a nil value).

Tests for grouping digits[uredi kodo]

{{val|12}} 12 12
{{val|123}} 123 123
{{val|1234}} 1234 1234
{{val|+1234}} +1234 +1234
{{val|12345}} 12345 12345
{{val|123456}} 123456 123456
{{val|1234567}} 1234567 1234567
{{val|12345678}} 12345678 12345678
{{val|123456789}} 123456789 123456789
{{val|1234567890}} 1234567890 1234567890
{{val|12345678901}} 12345678901 12345678901
{{val|123456789012}} 123456789012 123456789012
{{val|1234567890123}} 1234567890123 1234567890123
{{val|12345678901234}} 12345678901234 12345678901234
{{val|123456789012345}} 123456789012345 123456789012345
{{val|-12}} −12 −12
{{val|-123}} −123 −123
{{val|-1234}} −1234 −1234
{{val|-12345}} −12345 −12345
{{val|-123456}} −123456 −123456
{{val|-1234567}} −1234567 −1234567
{{val|-12345678}} −12345678 −12345678
{{val|-123456789}} −123456789 −123456789
{{val|-1234567890}} −1234567890 −1234567890
{{val|-12345678901}} −12345678901 −12345678901
{{val|-123456789012}} −123456789012 −123456789012
{{val|-1234567890123}} −1234567890123 −1234567890123
{{val|-12345678901234}} −12345678901234 −12345678901234
{{val|-123456789012345}} −123456789012345 −123456789012345
{{val|1,2}} 1,2 1,2
{{val|1,23}} 1,23 1,23
{{val|1,234}} 1,234 1,234
{{val|1,2345}} 1,2345 1,2345
{{val|1,23456}} 1,23456 1,23456
{{val|1,234567}} 1,234567 1,234567
{{val|1,2345678}} 1,2345678 1,2345678
{{val|1,23456789}} 1,23456789 1,23456789
{{val|1,234567890}} 1,234567890 1,234567890
{{val|1,2345678901}} 1,2345678901 1,2345678901
{{val|1,23456789012}} 1,23456789012 1,23456789012
{{val|1,234567890123}} 1,234567890123 1,234567890123
{{val|1,2345678901234}} 1,2345678901234 1,2345678901234
{{val|1,23456789012345}} 1,23456789012345 1,23456789012345

Formatting large numbers[uredi kodo]

{{val|12345}} 12345 12345
{{val|12345|12345}} 12345±12345 12345±12345
{{val|12345|(12345)}} 12345(12345) 12345(12345)
{{val|12345|12345|-12345}} 12345+12345
−12345
12345+12345
−12345
{{val|12345|e=12345}} 12345×1012345 12345×1012345
{{val|12345|e=-12345}} 12345×10−12345 12345×10−12345


code {{val}} {{val/peskovnik}}

Error messages[uredi kodo]

{{val|1|-2|nocategory=true}} 1±2 1±2
{{val|A|B|C|nocategory=true}} Lua error in Modul:Val at line 124: attempt to index local 'arg' (a nil value). Lua error in Modul:Val/peskovnik at line 124: attempt to index local 'arg' (a nil value).
{{val|1|B|C|nocategory=true}} Lua error in Modul:Val at line 124: attempt to index local 'arg' (a nil value). Lua error in Modul:Val/peskovnik at line 124: attempt to index local 'arg' (a nil value).
{{val|1|1|C|nocategory=true}} Lua error in Modul:Val at line 124: attempt to index local 'arg' (a nil value). Lua error in Modul:Val/peskovnik at line 124: attempt to index local 'arg' (a nil value).
{{val|1|e=A|nocategory=true}} Lua error in Modul:Val at line 124: attempt to index local 'arg' (a nil value). Lua error in Modul:Val/peskovnik at line 124: attempt to index local 'arg' (a nil value).
{{val|1|u=m|ul=m|nocategory=true}} Error in {{val}}: unit (u) and unit with link (ul) are both specified, only one is allowed. Error in {{val}}: unit (u) and unit with link (ul) are both specified, only one is allowed.
{{val|1|u=m|up=m|upl=m|nocategory=true}} Error in {{val}}: unit per (up) and unit per with link (upl) are both specified, only one is allowed. Error in {{val}}: unit per (up) and unit per with link (upl) are both specified, only one is allowed.