> 関数
数値 x* を小数点以下ちょうど *digits 桁で書いた文字列を返します:toFixed(1.0, 2) は "1.00" を返します。string では "1.0" になります。
数値は最も近い値に丸められ、ちょうど半分のときは 0 から遠い方に丸められます:toFixed(2.5, 0) は "3"、toFixed(-2.5, 0) は "-3" を返します。丸めは string が書く形の数値に対して行われるため、toFixed(1.005, 2) は "1.01" を返します。結果は常に小数点としてピリオドを使い、指数表記にはならず、"-0.00" にもなりません。
toFixed(1.0, 2) // "1.00"
toFixed(3.14159, 2) // "3.14"
toFixed(2.999, 2) // "3.00"
toFixed(0.1 + 0.2, 2) // "0.30"
toFixed(12345678.9, 2) // "12345678.90"
toFixed(-0.004, 2) // "0.00"
toFixed(7, 3) // "7.000"
(1.0).toFixed(2); // "1.00"
(3.14159).toFixed(2); // "3.14"
(1.005).toFixed(2); // "1.00"
(-0.004).toFixed(2); // "-0.00"
f"{1.0:.2f}" # '1.00'
f"{3.14159:.2f}" # '3.14'
format(1.005, ".2f") # '1.00'
format(0.125, ".2f") # '0.12'
Impossible de charger les données du jeu.
Vérifiez votre connexion et réessayez.