Template:Cents/doc: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
ArrowHead294 (talk | contribs)
mNo edit summary
Partial revert
Tag: Undo
Line 3: Line 3:
Use this template like this
Use this template like this


<pre>{{cents|ratio|precision}}</pre>
<pre>{{subst: cents|ratio|precision}}</pre>


=== Example ===
=== Example ===
This input in the wiki source
This input in the wiki source
<pre>{{cents|3/2|5}}</pre>
<pre>{{subst: cents|3/2|5}}</pre>


produces the following output
produces the following output
: {{{{ROOTPAGENAME}}|3/2|5}}
: 701.95500


Intervals can even be typed as evaluable mathematical expressions. For example:
Intervals can even be typed as evaluable mathematical expressions. For example:
<pre>{{cents|3^12/2^19|5}}</pre>
 
<pre>{{subst: cents|3^12/2^19|5}}</pre>


gives:
gives:
: {{{{ROOTPAGENAME}}|3^12/2^19|5}}
 
: 23.46001


=== See also ===
=== See also ===
* [[Template:Cent]] &ndash; A template to insert the cent symbol
* [[Template: Cent]] – a template to insert the cent symbol

Revision as of 18:49, 15 January 2025

Usage

Use this template like this

{{subst: cents|ratio|precision}}

Example

This input in the wiki source

{{subst: cents|3/2|5}}

produces the following output

701.95500

Intervals can even be typed as evaluable mathematical expressions. For example:

{{subst: cents|3^12/2^19|5}}

gives:

23.46001

See also