Template:Significant figures
外观
0
概要
此模板提供两个函数,取决于输入。
- 如果只提供一个参数,该模板计算提供的数字的有效数字。超出1012至 10−12、−10−12至−1012的数字将被忽略。
- 如果提供两个参数,该模板将第一个数字舍为第二个参数给出的有效数字数。
範例
两个参数
{{significant figures|123.456|7}}
→ 123.4560{{significant figures|123.456|6}}
→ 123.456{{significant figures|123.456|5}}
→ 123.46{{significant figures|123.456|4}}
→ 123.5
{{significant figures|123,456|3}}
→ 123,000{{significant figures|12345.6|3}}
→ 12,300{{significant figures|1234.56|3}}
→ 1,230{{significant figures|12.3456|3}}
→ 12.3{{significant figures|1.23456|3}}
→ 1.23
{{significant figures|.123456|3}}
→ 0.123{{significant figures|.0123456|3}}
→ 0.0123{{significant figures|.00123456|3}}
→ 0.00123{{significant figures|0.123456|3}}
→ 0.123{{significant figures|0.0123456|3}}
→ 0.0123{{significant figures|0.00123456|3}}
→ 0.00123
{{significant figures|123.456|2}}
→ 120{{significant figures|123.456|1}}
→ 100{{significant figures|123.456|0}}
→ 0
{{significant figures|987654321|9}}
→ 987,654,321{{significant figures|987654321|8}}
→ 987,654,320{{significant figures|987654321|7}}
→ 987,654,300{{significant figures|987654321|6}}
→ 987,654,000{{significant figures|987654321|5}}
→ 987,650,000{{significant figures|987654321|4}}
→ 987,700,000{{significant figures|987654321|3}}
→ 988,000,000{{significant figures|987654321|2}}
→ 990,000,000{{significant figures|987654321|1}}
→ 1.0×109
一个参数
{{significant figures|123400}}
→ 4{{significant figures|12340}}
→ 4{{significant figures|1234}}
→ 4{{significant figures|123.4}}
→ 4{{significant figures|12.34}}
→ 4{{significant figures|1.234}}
→ 4
{{significant figures|0.1234}}
→ 4{{significant figures|0.01234}}
→ 4{{significant figures|0.001234}}
→ 4{{significant figures|.1234}}
→ 4{{significant figures|.01234}}
→ 4{{significant figures|.001234}}
→ 4
{{significant figures|-123.4}}
→ 4{{significant figures|-12.34}}
→ 4{{significant figures|-1.234}}
→ 4
相关模板和模块
- {{Significant figures/rnd}},使用{{Rnd}},其使用{{#invoke:Math|precision_format}}
- {{Significant figures/sum}},使用{{Precision}},其使用{{#invoke:Math|precision}}
- {{Order of magnitude}}