Template documentation [view] [edit] [refresh] |
---|
Note: The template above may sometimes be partially or fully invisible. |
- Description
- This template is a shortcut for using parser function "formatnum" together with Template:Decimals.
- Instead of typing {{formatnum:{{decimals| and your data, accomplish the same thing with fewer keystrokes by typing {{formdec| and your data.
- Syntax
{{Formdec|<number or expression>|<(optional) decimals (limited to 12) (0 if omitted)>}}
- The second parameter, "decimals", is optional. If decimals is omitted, the template use a default value of 0.
- Optional super-shortcut:
- Editors may save time (and code space) by using {{Fd}} in place of {{Formdec}}.
- Sample output of long form, shortcut, and super-shortcut, compared
{{formatnum:{{decimals|9876*1234/56|4}}}}
→ 217,624.7143{{formdec|9876*1234/56|4}}
→ 217,624.7143{{fd|9876*1234/56|4}}
→ 217,624.7143
{{formatnum:{{decimals|9876*1234/56|1}}}}
→ 217,624.7{{formdec|9876*1234/56|1}}
→ 217,624.7{{fd|9876*1234/56|1}}
→ 217,624.7
{{formatnum:{{decimals|9876*1234/56|0}}}}
→ 217,625{{formdec|9876*1234/56|0}}
→ 217,625{{fd|9876*1234/56|0}}
→ 217,625
{{formatnum:{{decimals|9876*1234/56}}}}
→ 217,625{{formdec|9876*1234/56}}
→ 217,625{{fd|9876*1234/56}}
→ 217,625- Note: Omitting final parameter (decimals) gives result using decimals = 0.
- See also
- {{Decimals}}
Community content is available under CC-BY-SA unless otherwise noted.