toFixed
種類
メソッド
書式
数値.toFixed(小数点位置)
解説
小数点を指定した位置にします。
サンプルコード
num = 123.456789;
n = num.toFixed(2);
alert(n);
実際のスクリプトを
ダウンロード