Predloga:Odstotek
Uporablja Lua: |
Uporaba
[uredi kodo]{{Odstotek | numerator | denominator | decimals to round to (zero or greater) }}
Omejitve
[uredi kodo]Števila manjša od 0,0001% so izpisna z znanstveno notacijo.
Zgledi
[uredi kodo]- {{Odstotek | 1 | 3 | 0 }} izpiše 33 %
- {{Odstotek | 1 | 3 | 2 }} izpiše 33.33 %
Uporabijo se lahko negativne vrednosti:
- {{Odstotek | -1 | 3 }} izpiše -33 %
Normal operation is to cut off all decimal zeroes from right in rounding:
- {{Odstotek | 1 | 5 | 2 }} izpiše 20 %
- {{Odstotek | 1111 | 10000 | 4 }} izpiše 11.11 %
Add |pad=yes to always get as many decimals as specified, padding with zeroes where needed:
- {{Odstotek | 1 | 5 | 2 | pad=yes }} izpiše 20,00 %
- {{Odstotek | 1111 | 10000 | 4 | pad=yes }} izpiše 11,1100 %
Third parameter can also be given through |pad=N:
- {{Odstotek | 111 | 1000 | pad=4 }} is same as {{Odstotek | 111 | 1000 | 4 | pad=yes }} and izpiše 11,1000 %
Default denominator is 100:
- {{Odstotek | 20 }} izpiše 20 %
Default precision is zero:
- {{Odstotek | 1 | 3 }} izpiše 33 %
Override the percent symbol
- {{Odstotek | 1 | 3 | % = percent}} izpiše 33 %
Use a prescribed number of significant figures
- {{Odstotek | 1 | 4000 | sigfig = 3}} izpiše 0,0250 %
Use a prescribed number of significant figures with small percentages
- {{Odstotek | 1 | 40000000 | sigfig = 3}} izpiše 00 %
Use a prescribed number of significant figures with small percentages without scientific notation
- {{Odstotek | 1 | 40000000 | sigfig = 3 | nonscinote = y}} izpiše 00 %
Use a prescribed number of significant figures with large percentages
- {{Odstotek | 40000000 | 2 | sigfig = 3}} izpiše 2,00×109 %
Use a prescribed number of significant figures with large percentages without scientific notation
- {{Odstotek | 40000000 | 2 | sigfig = 3 | nonscinote = y}} izpiše 2,00×109 %
TemplateData
[uredi kodo]TemplateData za Odstotek
Calculates and displays a percentage value.
Parameter | Opis | Vrsta | Stanje | |
---|---|---|---|---|
Numerator | 1 | The Numerator of the calculated value. The percentage will be calculated as Numerator divided by Demoninator. | Številka | zahtevano |
Denominator | 2 | The Demoninator of the calculated value. The percentage will be calculated as Numerator divided by Demoninator. Can be left out, in which case 100 will be used as the Demoninator, and the Numerator will be the direct percentage used.
| Številka | predlagano |
Decimals | 3 | Number of decimals to round to (zero or greater); if pad is not Yes, 0-digits will be cropped from the end.
| Številka | neobvezno |
Pad / actual number of digits | pad | If yes, use all digits given in Decimals. If a number, pad to that number of decimals. | Niz | neobvezno |
Significant figures | sigfig | If set to a positive integer, the precision of the returned number will be adjusted to match the requested number of significant figures. | Številka | neobvezno |
% replacement | % | Replacement for % symbol
| Niz | neobvezno |
Aliasi
[uredi kodo]Glej tudi
[uredi kodo]- {{Percent-done}}
- {{Round}}
- {{Significant figures}}
- {{Fractions and ratios}}
- {{Winning percentage}}
- {{Number and percent}}