テンプレート:Rounddown

提供:脳科学辞典
2015年3月14日 (土) 12:15時点におけるNijcadmin (トーク | 投稿記録)による版 (1版)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
ナビゲーションに移動 検索に移動


This template rounds a numeric expression down to a given number of decimal places. Down in the sense that e.g. -2.5 is rounded to -3. Compare

.

Usage:
{{Rounddown|expression}}
{{Rounddown|expression|decimals}}
Both parameters can be any valid numeric expression.
The decimals parameter defaults to 0 and is rounded to the nearest integer.
decimals can be negative to round down to a multiple of a power of ten.
Examples:
{{Rounddown|3.14159|3}} = 3.141
{{Rounddown|-3.14159|3}} = -3.142
{{Rounddown|314159|-3}} = 314000
{{Rounddown|-314159|-3}} = -315000
{{Rounddown|+1/3}} = 0
{{Rounddown|2<1}} = 0
{{Rounddown|-1/3}} = -1
{{Rounddown|-2/3}} = -1
For expressions containing equal signs use 1=expression - the second example fails:
{{Rounddown|1=3<=4}} = 1
{{Rounddown|3<=4}} = 構文エラー: 予期しない演算子 < です。

See also