Template:Sigfig: Difference between revisions

No edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{#expr:({{{1}}}) round ({{{2|3}}} - floor (ln (abs ({{{1}}}))/ln (10)) - 1)}}</includeonly><noinclude>
<includeonly>{{#invoke: Utils | round
This template rounds a number to a given number of significant figures. The first argument is the number to be rounded. The second argument is the number of significant figures. If not specified the default value is 3.
| {{{1|0}}}
 
| {{{2|3}}}
== Usage ==
}}</includeonly><noinclude>
; You type
{{documentation}}
: <code><nowiki>{{sigfig|1234.567|5}}</nowiki></code>
 
; You get
: 1234.6


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>