Template:ExactlyOrAbout: Difference between revisions
mNo edit summary |
+examples |
||
Line 1: | Line 1: | ||
<includeonly>{{#ifeq: {{#expr: {{sigfig| {{{1}}} }} - {{{1}}} }} | 0 |exactly|about}} {{sigfig| {{{1}}} }}</includeonly><noinclude> | <includeonly>{{#ifeq: {{#expr: {{sigfig| {{{1}}} }} - {{{1}}} }} | 0 |exactly|about}} {{sigfig| {{{1}}} }}</includeonly><noinclude> | ||
If the input value ''x'' to 3 [[Wikipedia: Significant figures|significant figures]] = the exact value, display "exactly ''x''"; otherwise display "about ''x''". | If the input value ''x'' to 3 [[Wikipedia: Significant figures|significant figures]] = the exact value, display "exactly ''x''"; otherwise display "about ''x''". | ||
== Usage == | |||
; You type | |||
: <code><nowiki>{{ExactlyOrAbout|24}}</nowiki></code> | |||
: <code><nowiki>{{ExactlyOrAbout|16.667}}</nowiki></code> | |||
; You get | |||
: {{{{PAGENAME}}|24}} | |||
: {{{{PAGENAME}}|16.667}} | |||
== See also == | == See also == | ||
* [[Template:Sigfig]] – the template that rounds a number to a given number of significant figures | * [[Template:Sigfig]] – the template that rounds a number to a given number of significant figures | ||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> |