Home  

Random  

Nearby  



Log in  



Settings  



Donate  



About Wikipedia  

Disclaimers  



Wikipedia





Template:Number and percent





Template  

Talk  



Language  

Watch  

Edit  





  • 2 Basic examples
  • 3 Table display
  • 4 See also
  • Usage

    edit

    Optional parameters

    edit

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

    To show the total with the table option, use |total=yes

    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= units

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

    To specify a number n of significant figures for the percentage, use |sigfig=n.

    To specify a percentage suffix (e.g. per cent) other than %, use |%=suffix, e.g. |%=per cent.

    To override the scientific notation default for very large and very small numbers, use |nonscinote=yes.

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

    The percent font size may be specified with |size=, e.g. |size=small, |size=90%.

    Basic examples

    edit

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

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

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

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

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

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

    Table display

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

    See also

    edit

    Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Number_and_percent&oldid=1222313145"
     



    Last edited on 5 May 2024, at 07:50  


    Languages

     



     / Bân-lâm-gú
    فارسی
    Հայերեն
    Ilokano
    Íslenska
    Ladin
    ि
    Македонски



    Română
    Simple English


    Türkçe
    اردو
    Tiếng Vit

     

    Wikipedia


    This page was last edited on 5 May 2024, at 07:50 (UTC).

    Content is available under CC BY-SA 4.0 unless otherwise noted.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Terms of Use

    Desktop