ढाँचा:Percentage/doc

स्वतन्त्र विश्वकोश, नेपाली विकिपिडियाबाट
Jump to navigation Jump to search

Usage[सम्पादन गर्ने]

{{percentage | numerator | denominator | decimals to round to (zero or greater) }}

Examples[सम्पादन गर्ने]

  • {{Percentage | 1 | 3 | 0 }} yields &0000000000000033000000३३%
  • {{Percentage | 1 | 3 | 2 }} yields &0000000000000033329999३३.३३%

Negative values can be used:

  • {{Percentage | -1 | 3 }} yields &-1-1-1-1-1-1-1-1-1-1-1-1-1-1-4-3000000-३३%

Nornal operation is to cut off all decimal zeroes from right in rounding:

  • {{Percentage | 1 | 5 | 2 }} yields &0000000000000020000000२०%
  • {{Percentage | 1111 | 10000 | 4 }} yields &0000000000000011109999११.११%

Add |pad=yes to always get as many decimals as specified, padding with zeroes where needed:

  • {{Percentage | 1 | 5 | 2 | pad=yes }} yields &0000000000000020000000२०.००%
  • {{Percentage | 1111 | 10000 | 4 | pad=yes }} yields &0000000000000011109999११.११००%

Third parameter can also be given through |pad=N:

  • {{Percentage | 111 | 1000 | pad=4 }} is same as {{Percentage | 111 | 1000 | 4 | pad=yes }} and yields &0000000000000011099999११.१०००%

Default denominator is 100:

  • {{Percentage | 20 }} yields &0000000000000020000000२०%

Default precision is zero:

  • {{Percentage | 1 | 3 }} yields &0000000000000033000000३३%

Override the percent symbol

  • {{Percentage | 1 | 3 | % =  percent}} yields &0000000000000033000000३३ percent

Aliases[सम्पादन गर्ने]

  • {{pct}}
  • {{percent}}

See also[सम्पादन गर्ने]