Bahaipedia
Bahaipedia
Menu
About Bahaipedia
Ask a question
General help
Random page
Recent changes
In other projects
Tools
What links here
Related changes
Upload file
Special pages
Printable version
Permanent link
Page information
Template
Discussion
View history
Talk
Contributions
Create account
Log in
Navigation
About Bahaipedia
Ask a question
General help
Random page
Recent changes
In other projects
Learn more
Core topics
Bahá’í Faith
Central Figures
Teachings
Practices
Tools
What links here
Related changes
Upload file
Special pages
Printable version
Permanent link
Page information
Translations

Template:Precision

From Bahaipedia
Jump to:navigation, search
Template documentation[view] [edit] [history] [purge]
This documentation is transcluded from Template:Precision/doc. (edit | history)

Given a decimal value, return the precision, as an integer of the number of digits past the decimal point. Negative numbers are returned for precision left of the decimal point.

Note that floating point values have a maximum number of digits total, so 1111111111.11111111 is equivalent to 1111111111.1111111 (one less digit after decimal point), so the output of {{precision}} for both of those is 7.

Examples[edit]

{{Precision|1111.123456789}} 9
{{Precision|1111.12345678}} 8
{{Precision|1111.1234567}} 7
{{Precision|1111.123456}} 6
{{Precision|1111.12345}} 5
{{Precision|1111111111.12345678}} 6
{{Precision|1111111111.1234567}} 6
{{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

See also[edit]

  • Template:Precision1
The above documentation is transcluded from Template:Precision/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://bahaipedia.org/index.php?title=Template:Precision&oldid=22997"
Category:
  • Mathematical function templates
This page was last edited on 27 August 2008, at 05:58.
Text is available under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.
Privacy policy
About Bahaipedia
Disclaimers
Powered by MediaWiki