Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Usage  





2 Limitations  





3 Examples  





4 TemplateData  





5 See also  














Template:Percentage






Аԥсшәа
العربية

Asturianu
Авар
Azərbaycanca
تۆرکجه

 / Bân-lâm-gú

Български
Bosanski
Буряад
Català
Cebuano
Dansk
Deutsch
Eesti
Ελληνικά
Español
Euskara
فارسی
Føroyskt
Français

Հայերեն
ि
Ilokano
Bahasa Indonesia
Íslenska
Italiano
עברית
Jawa


Kurdî
Ladin
Lëtzebuergesch
ि
Македонски

Bahasa Melayu
Minangkabau
Монгол

Nederlands


Norfuk / Pitkern
ି
Oʻzbekcha / ўзбекча

پښتو

Português
Română
Русский
Scots

Simple English
سنڌي
Slovenščina
Soomaaliga
کوردی
Српски / srpski
Srpskohrvatski / српскохрватски
Svenska
Tagalog
ி
Татарча / tatarça
 


Тоҷикӣ
Türkçe
Українська
اردو
Tiếng Vit



 

Edit links
 









Template
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
Meta-Wiki
 
















Appearance
   

 





Permanently protected template

From Wikipedia, the free encyclopedia
 


  • {{percent}}
  • Usage

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

    Limitations

    Figures smaller than 0.0001% are shown in scientific notation.

    Examples

    Negative values can be used:

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

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

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

    Default denominator is 100:

    Default precision is zero:

    Override the percent symbol

    Use a prescribed number of significant figures

    Use a prescribed number of significant figures with small percentages

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

    Use a prescribed number of significant figures with large percentages

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

    Dividing by zero will result in "nan" (undefined)

    TemplateData

    This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Percentage in articles based on its TemplateData.

    TemplateData for Percentage

    Calculates and displays a percentage value.

    Template parameters[Edit template data]

    ParameterDescriptionTypeStatus
    Numerator1

    The Numerator of the calculated value. The percentage will be calculated as Numerator divided by Denominator. Use of comma as a thousands separator is optional.

    Numberrequired
    Denominator2

    The Denominator of the calculated value. The percentage will be calculated as Numerator divided by Denominator. Use of comma as a thousands separator is optional. Can be left out, in which case 100 will be used as the Denominator, 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

    See also


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

    Categories: 
    Lua-based templates
    Mathematical function templates
    Hidden categories: 
    Wikipedia template-protected templates
    Templates using TemplateData
     



    This page was last edited on 8 December 2019, at 15:23 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki