ढाँचा:Rnd/b1
This is an auxiliary template of Template:Rnd, called if the number, after rounding, is positive. Thus this description is about internal details only.
Its first parameter is the result of regular rounding with #expr and the function round (but if written in scientific format, as expression not always evaluating to the exact round number, see below), its second the rounding parameter, and its third the value of the condition that the rounding parameter is positive.
It calls one of the following templates, passing on the first and second parameter:
- Template:Rnd/c2dec1
- Template:Rnd/c4dec0
- Template:Rnd/c4dec1
- Template:Rnd/c6dec0
- Template:Rnd/c6dec1
- Template:Rnd/c8dec0
- Template:Rnd/c8dec1 (redirecting to the previous one)
where the last digit is the value of the condition that the rounding parameter is positive, and the digit after the c depends on the range of the rounded number:
- less than 1e-4: 2 (only possible if the rounding parameter is positive)
- from 1e-4 to 1e5: 4
- from 1e5 to 1e9: 6 if the number is a multiple of 1e5, otherwise 4
- 1e9 or more: 8
Multiples of 1e5 between 1e5 and 1e9 are treated separately to avoid scientific notation.
Examples
सम्पादन गर्नुहोस्{{rnd/b1|.0008|5|1}}
→ 0.00080{{rnd/b1|1E+5|-5|0}}
→ 100000{{rnd/b1|1.2E+6|-5|0}}
→ 1200000{{rnd/b1|4.1E+6|10|1}}
→ 4100000.0000000000{{rnd/b1|1540000000|-5|0}}
→ 1.5400×109{{rnd/b1|1542689271|2|1}}
→ 1.54268927100×109
Notes
सम्पादन गर्नुहोस्This template checks whether the exact 14-digit number that the input value represents (not to be confused with the float value to which it evaluates) is a multiple of 100,000. It does this by comparing the number with that rounded to a multiple of 100,000. The comparison is done after applying #expr to both sides. Experiments suggest that {{#expr:{{#expr:f}}}}
gives the same string for all floats f for which {{#expr:f}}
mathematically represents the same number, see m:Help:Format produced by expr#Categorizing floats by the mathematical value of the string produced by expr.