Modèle:Fraction
Révision datée du 5 janvier 2019 à 08:26 par PayJi (discussion | contributions) (Page créée avec « {{#if:{{#pos:{{{1|0}}}|.}} |{{#vardefine:integer|{{#explode:{{{1}}}|.|0}}}}{{#vardefine:fraction|{{#explode:{{{1}}}|.|1}}}}{{#ifexpr:{{#var:integer}}>0|{{#var:integer}}|... »)
0
Usage
{{fraction|<number>}}
This template takes a decimal number and converts the fraction part into the appropriate character entity. Only supports quarter fractions, i.e. 0.25, 0.5, and 0.75. Any other fraction will simply be returned as input.
- Examples
{{fraction|0.5}}
→ ½{{fraction|4.25}}
→ 4Modèle:1/4{{fraction|1.2}}
→ 1.2