Template:Sigfig: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Created page with "{{#expr:({{{1}}}) round ({{{2|3}}} - floor (ln (abs ({{{1}}}))/ln (10)))}}"
 
ArrowHead294 (talk | contribs)
mNo edit summary
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{#expr:({{{1}}}) round ({{{2|3}}} - floor (ln (abs ({{{1}}}))/ln (10)))}}
<includeonly>{{#invoke: Utils | round
| {{{1|0}}}
| {{{2|3}}}
}}</includeonly><noinclude>
{{documentation}}
 
[[Category:Templates]]
</noinclude>

Latest revision as of 14:59, 31 January 2025

Template documentation[view] [edit] [history] [purge]
This template invokes the following functions: round from Utils.

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.

Usage

You type
{{sigfig|1234.567|5}}
You get
1234.6