• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.49
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Plusminus%

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here
(Redirected from Template:±%)


Template documentation[view] [edit] [history] [purge]

Formats number as a ±percentage (“+#.#%”, “— ”, or “−#.#%”) formatting to the specified number of decimal places.

Usage

{{ Plusminus% | number | decimals }} (a.k.a. {{ ±% | number | decimals }})

where:

Parameter Description Default
 1  number   is a ±number between than 1.0 and −1.0 (for percentages between +100% and −100%) 0  
2 decimals   is the number of decimals to be displayed in the rounded, formatted percentage figure (i.e. decimals =1 → 100.0%) 1  

Examples

Code yields
{{±% | 0.1234567 | 2 }} +12.35%
{{±% | -0.1234567 | 4 }} −12.3457%
{{Plusminus% | 0 | 4 }} —          
{{Plusminus% | 0 | 2 }} —      
{{Plusminus% | 0 | 0 }} —  
{{±% | 0.1 | 0 }} +10%
{{±% | 0 }} —    
{{±% | 0.54321 }} +54.3%
{{±%}} +0.0%
{{±% | 0.567 | -1 }} +50%
The above documentation is transcluded from Template:Plusminus%/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://moasspedia.org/w/index.php?title=Template:Plusminus%25&oldid=27036"
Last edited on 11 September 2020, at 12:31

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 11 September 2020, at 12:31.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop