Template:ExactlyOrAbout/doc: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Ganaram inukshuk (talk | contribs)
do not overcomplicate (1/2)
Ganaram inukshuk (talk | contribs)
do not overcomplicate
Line 1: Line 1:
{{dochead}}
{{dochead}}
If the input value ''x'' to <code>{{{sigfigs}}}</code> (3 by default) [[Wikipedia: Significant figures|significant figures]] = the exact value of ''x'', display "exactly ''x''"; otherwise display "about ''x''" (rounded to specified significant figures).  
If the input value ''x'' to <code><nowiki>{{{sigfigs}}}</nowiki></code> (3 by default) [[Wikipedia: Significant figures|significant figures]] = the exact value of ''x'', display "exactly ''x''"; otherwise display "about ''x''" (rounded to specified significant figures).  


=== Usage ===
=== Usage ===
Line 6: Line 6:
! You type !! You get
! You type !! You get
|-
|-
| <code>{{ExactlyOrAbout&#124;24}}</code> || {{{{ROOTPAGENAME}}|24}}
| <code><nowiki>{{ExactlyOrAbout|24}}</nowiki></code> || {{{{ROOTPAGENAME}}|24}}
|-
|-
| <code>{{ExactlyOrAbout&#124;16.667}}</code> || {{{{ROOTPAGENAME}}|16.667}}
| <code><nowiki>{{ExactlyOrAbout|16.667}}</nowiki></code> || {{{{ROOTPAGENAME}}|16.667}}
|-
|-
| <code>{{ExactlyOrAbout&#124;16.667&#124;sigfigs=4}}</code> || {{{{ROOTPAGENAME}}|16.667|sigfigs=4}}
| <code><nowiki>{{ExactlyOrAbout|16.667|sigfigs=4}}</nowiki></code> || {{{{ROOTPAGENAME}}|16.667|sigfigs=4}}
|-
|-
| <code>{{ExactlyOrAbout&#124;16.67&#124;sigfigs=4}}</code> || {{{{ROOTPAGENAME}}|16.67|sigfigs=4}}
| <code><nowiki>{{ExactlyOrAbout|16.67|sigfigs=4}}</nowiki></code> || {{{{ROOTPAGENAME}}|16.67|sigfigs=4}}
|}
|}


=== 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

Revision as of 09:45, 28 September 2024

If the input value x to {{{sigfigs}}} (3 by default) significant figures = the exact value of x, display "exactly x"; otherwise display "about x" (rounded to specified significant figures).

Usage

You type You get
{{ExactlyOrAbout|24}} exactly 24
{{ExactlyOrAbout|16.667}} about 16.7
{{ExactlyOrAbout|16.667|sigfigs=4}} about 16.67
{{ExactlyOrAbout|16.67|sigfigs=4}} exactly 16.67

See also

  • Template:Sigfig – the template that rounds a number to a given number of significant figures