Template:Dec to frac: Difference between revisions
Appearance
wikademia>Ezhiki +doc |
wikademia>Ezhiki |
||
| Line 11: | Line 11: | ||
==Known issues== | ==Known issues== | ||
Since the resulting fraction is the closest of what can be achieved using the | Since the resulting fraction is the closest to the decimal fraction of what can be achieved using the requested denominator, this template may occasionally produce odd results: | ||
*<nowiki>{{dec to frac|3.999|9}}</nowiki> → {{dec to frac|3.999|9}} | *<nowiki>{{dec to frac|3.999|9}}</nowiki> → {{dec to frac|3.999|9}} | ||
[[Category:Mathematical function templates]] | [[Category:Mathematical function templates]] | ||
</noinclude> | </noinclude> | ||
Revision as of 19:42, 3 August 2007
This template converts decimal fractions to vulgar fractions. It takes two parameters:
- fraction to be converted;
- resulting vulgar fraction's denominator
If the decimal fraction includes an integer part, it is retained in the output. If the resulting vulgar fraction can be resolved in lower terms than specified denominator, it is resolved.
Examples
- {{dec to frac|3.6742|16}} → Template:Frac
- {{dec to frac|0.375|16}} → Template:Frac
Known issues
Since the resulting fraction is the closest to the decimal fraction of what can be achieved using the requested denominator, this template may occasionally produce odd results:
- {{dec to frac|3.999|9}} → Template:Frac