![]() | This is the template sandbox page for Template:Precision (diff). See also the companion subpage for test cases. |
![]() | This template is used on approximately 279,000 pages. To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. Preview message: Transclusion count updated automatically (see documentation). |
![]() | This template uses Lua: |
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.
{{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 |
© MMXXIII Rich X Search. We shall prevail. All rights reserved. Rich X Search