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
 

















Template:Precision






Afrikaans
العربية
Արեւմտահայերէն

Basa Bali

 / Bân-lâm-gú
Башҡортса
Беларуская (тарашкевіца)

Bosanski
Brezhoneg
Català
Chavacano de Zamboanga
ChiShona
Dansk
Ελληνικά
فارسی
Fiji Hindi
Føroyskt
Galego


Հայերեն
Ilokano
IsiZulu
Íslenska
Jawa

Kongo
Kurdî
Кыргызча
Latina
Latviešu
Luganda
Magyar
Madhurâ
ि
Македонски


مصرى
Bahasa Melayu



Norfuk / Pitkern
Novial
ି

Pangasinan
پنجابی

پښتو

Polski
Português
Română
Русский
Gagana Samoa

Scots

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


Türkçe
Українська
اردو
Tiếng Vit
Winaray
Yorùbá


 
 

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
Wikibooks
Wikiversity
 
















Appearance
   

 





Permanently protected template

From Wikipedia, the free encyclopedia
 



The Template:Precision determines the precision (as a count of decimal digits) for any amount, large or negative, using a fast algorithm. It can also handle a trailing decimal point (such as "15." or "-41.") or trailing zeroes (such as "15.34000" having precision as 5 decimal digits). For fractional input it returns the base ten logarithm of the numerator.

Examples

{{Precision|1111.123456789}} 9
{{Precision|1111.12345678}} 8
{{Precision|1111.1234567}} 7
{{Precision|1111.123456}} 6
{{Precision|1111.12345}} 5
{{Precision|1111111111.12345678}} 8
{{Precision|1111111111.1234567}} 7
{{Precision|1111111111.123456}} 6
{{Precision|1111111111.12345}} 5
{{Precision|1111111111.1234}} 4
{{Precision|1111111111.123}} 3
{{Precision|1111111111.12}} 2
{{Precision|1111111111.1}} 1
{{Precision|1111111111.10}} 2
{{Precision|1111111111.100}} 3
{{Precision|1111111111.1000}} 4
{{Precision|1111111111.10000}} 5
{{Precision|1111111111}} 0
{{Precision|1111111110}} -1
{{Precision|1111111100}} -2
{{Precision|1111111000}} -3
{{Precision|1111110000}} -4
{{Precision|1111100000}} -5
{{Precision|1111000000}} -6
{{Precision|1110000000}} -7
{{Precision|1100000000}} -8
{{Precision|0}} 0
{{Precision|1}} 0
{{Precision|22.45}} 2
{{Precision|22.12345}} 5
{{Precision|22}} 0
{{Precision|22000}} -3
{{Precision|-15.275}} 3
{{Precision|-15.2500}} 4
{{Precision|23000222000111.432}} 3
{{Precision|-15.123}} 3
{{Precision|0.09}} 2
{{Precision|0.88}} 2
{{Precision|880000}} -4
{{Precision|90000000}} -7

Known bugs

Technical notes

See also


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

Categories: 
Templates based on the Math Lua module
Mathematical function templates
Hidden category: 
Wikipedia template-protected templates
 



This page was last edited on 25 March 2017, at 12:38 (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