Predloga:Odstotek

Iz Wikipedije, proste enciklopedije
Jump to navigation Jump to search
Documentation icon Dokumentacija predloge[predogled] [uredi] [zgodovina] [osveži]

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 percent

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 2,50×10−6%

Use a prescribed number of significant figures with small percentages without scientific notation

  • {{Odstotek | 1 | 40000000 | sigfig = 3 | nonscinote = y}} izpiše 2,50×10−6%

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]

To je TemplateData dokumentacija za predlogo, ki jo uporablja VisualEditor in druga orodja; glejte mesečno poročilo o uporabi parametrov za to predlogo.

TemplateData za Odstotek

Calculates and displays a percentage value.

Template parameters

ParameterDescriptionTypeStatus
Numerator1

The Numerator of the calculated value. The percentage will be calculated as Numerator divided by Demoninator.

Numberrequired
Denominator2

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.

Default
100
Numbersuggested
Decimals3

Number of decimals to round to (zero or greater); if pad is not Yes, 0-digits will be cropped from the end.

Default
0
Numberoptional
Pad / actual number of digitspad

If yes, use all digits given in Decimals. If a number, pad to that number of decimals.

Stringoptional
Significant figuressigfig

If set to a positive integer, the precision of the returned number will be adjusted to match the requested number of significant figures.

Numberoptional
% replacement%

Replacement for % symbol

Example
 percent
Stringoptional

Aliasi[uredi kodo]

Glej tudi[uredi kodo]