الگو:Rnd
ظاهر
Usage
This template rounds {{{1}}} to {{{2}}} decimal places (goes the other way for negatives) and includes trailing zeros. Scientific notation is used for numbers greater than or equal to 1×۱۰۹, or less than 1×۱۰−۴.
Compare:
- {{
rnd|2.0004|3}} gives ۲٫۰۰۰- whereas {{
#expr:2.0004 round 3}} gives 2
- whereas {{
- {{
rnd|0.000020004|7}} gives ۲٫۰۰×۱۰−۵ - {{
rnd|0|8}} gives ۰٫۰۰۰۰۰۰۰۰ - {{
rnd|154268|-3}} gives ۱۵۴۰۰۰ {{rnd|1200004|-1}}← ۱۲۰۰۰۰۰- whereas
{{#expr:1200004round-1}}← 1200000, even though{{#expr:1300004round-1}}← 1300000 (see m:Help:Format produced by expr)
- whereas
{{rnd|1300004|-1}}← ۱۳۰۰۰۰۰{{rnd|4.1e6|9}}← ۴۱۰۰۰۰۰٫۰۰۰۰۰۰۰۰۰{{rnd|4.1e6|10}}← ۴۱۰۰۰۰۰٫۰۰۰۰۰۰۰۰۰۰{{rnd|1542689271|-7}}← ۱۵۴۰۰۰۰۰۰۰
×۱۰-۷
{{rnd|1542689271|2}}← ۱۵۴۲۶۸۹۲۷۱
×۱۰۲
{{rnd|7e9|-9}}← ۷۰۰۰۰۰۰۰۰۰
×۱۰-۹
{{rnd|-123|1}}← −۱۲۳٫۰{{rnd|-1200007|-2}}← −۱۲۰۰۰۰۰{{rnd|-1234567899|-7}}← −--۱۲۳۰۰۰۰۰۰۰
×۱۰-۷
As with #expr, the total number of significant digits is not more than 14:
{{rnd|1234567890.123456789|10}}← ۱۲۳۴۵۶۷۸۹۰٫۱۲۳۵
×۱۰۱۰
{{rnd|123456789.0123456789|10}}← ۱۲۳۴۵۶۷۸۹٫۰۱۲۳۵۰۰۰۰۰{{rnd|.0001234567890123456789|20}}← ۰٫۰۰۰۱۲۳۴۵۶۷۸۹۰۱۲۳۵
Internal details
The template uses three subtemplates: