Toggle menu
15
236
70
27.5K
Kenshi Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 06:26, 18 February 2025 by Prd (talk | contribs) (Created page with "{{Documentation subpage}} {{tsh|p+n|p&n|pan}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> This template may be used to generate a percentage of total followed by the number. For the reverse, see {{tl|number and percent}}. == Usage == *<code><nowiki>{{percent and number|number|total}}</nowiki></code> *<code><nowiki>{{percent and number|number|total|decimals to round to (zero or greate...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This template may be used to generate a percentage of total followed by the number. For the reverse, see {{number and percent}}.

Usage

  • {{percent and number|number|total}}
  • {{percent and number|number|total|decimals to round to (zero or greater)}}

Optional parameters

For two-column table output, use |disp=table

To insert a line break before the parenthetical expression, use |disp=br()

To add a prefix to the numbers, use |prefix=; for example, prefix=$

To add a suffix to the number, use |suffix=; for example, suffix=&nbsp;units

To pad the result with zeros to achieve the desired precision, use |pad=yes.

To override the default right alignment in table mode, use |align=left or |align=center.

Basic examples

{{percent and number|3333|20000}}17% (3,333)

{{percent and number|3333|20000|3}}16.665% (3,333)

{{percent and number|3,333|20,000}}17% (3,333)

{{percent and number|3,333|20,000|3}}16.665% (3,333)

{{percent and number|111|1000|4|pad=yes}}11.1000% (111)

{{percent and number|3333|20000|disp=br()}}17%
(3,333)

Table display

{| class="wikitable sortable"
|-
! Location !! Percentage !! Population 
|-
| City A || {{percent and number|5000|12000|disp=table}}
|-
| City B || {{percent and number|6500|12000|disp=table}}
|-
| City C || {{percent and number|500|12000|disp=table}}
|}
Location Percentage Population
City A 42% 5,000
City B 54% 6,500
City C 4% 500

See also