以下の内容はhttps://iww.hateblo.jp/entry/20190319/digitより取得しました。


小数点以下の桁数を指定して表示する

123456 を 123456.00 みたいに小数点以下の桁数を指定して表示する

var a = 123456;
var n = 2;
console.log( a.toFixed(n) ); // 123456.00

Number.prototype.toFixed() - JavaScript | MDN

<?
$a = 123456;
$n = 2;
print number_format($a, $n, ".", ""); // 123456.00

PHP: number_format - Manual

double a = 123456;
int n = 2;

printf("%.*lf\n", n, a); // 123456.00

Man page of PRINTF




以上の内容はhttps://iww.hateblo.jp/entry/20190319/digitより取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14