More actions
Shows a number with the given number of significant figures. Uses the scientific notation if the number is longer than the requested significant figures.
Usage | Produces |
---|---|
{{sigfigs|1234567|7}} |
N/A|N/A|{{#ifexpr: abs(floor(ln(1234567)/ln(10))) + 1>7|{{#number_format:{{#expr: 1234567/10^floor(ln(1234567)/ln(10)) round 7 - 1}}|{{#expr: 7 - 1}}}}×10{{#number_format:{{#expr: floor(ln(1234567)/ln(10))}}}}|{{#number_format:1234567|{{#expr: 7-{{#ifexpr: ln(1234567) >= 0|abs(floor(ln(1234567)/ln(10)))-1|0}}}}}}}}}} |
{{sigfigs|12345678901234567890|5}} |
N/A|N/A|{{#ifexpr: abs(floor(ln(12345678901234567890)/ln(10))) + 1>5|{{#number_format:{{#expr: 12345678901234567890/10^floor(ln(12345678901234567890)/ln(10)) round 5 - 1}}|{{#expr: 5 - 1}}}}×10{{#number_format:{{#expr: floor(ln(12345678901234567890)/ln(10))}}}}|{{#number_format:12345678901234567890|{{#expr: 5-{{#ifexpr: ln(12345678901234567890) >= 0|abs(floor(ln(12345678901234567890)/ln(10)))-1|0}}}}}}}}}} |
{{sigfigs|0.123456789012345678|5}} |
N/A|N/A|{{#ifexpr: abs(floor(ln(0.123456789012345678)/ln(10))) + 1>5|{{#number_format:{{#expr: 0.123456789012345678/10^floor(ln(0.123456789012345678)/ln(10)) round 5 - 1}}|{{#expr: 5 - 1}}}}×10{{#number_format:{{#expr: floor(ln(0.123456789012345678)/ln(10))}}}}|{{#number_format:0.123456789012345678|{{#expr: 5-{{#ifexpr: ln(0.123456789012345678) >= 0|abs(floor(ln(0.123456789012345678)/ln(10)))-1|0}}}}}}}}}} |