Open eborden opened 10 years ago
Float.toPrecision(int) int -> string
$f = 5.123456; $f.toPrecision(); //"5.123456" $f.toPrecision(5); //"5.1235" $f.toPrecision(2); //"5.1" $f.toPrecision(1); //"5"
Float.toFixed(int) int -> string
$f = 5.123456; $f.toFixed(); //"5.123456" $f.toFixed(1); //"5.1" $f.toFixed(2); //"5.12" $f.toFixed(3); //"5.123" $f.toFixed(10); //"5.1234560000"
Float.toPrecision(int) int -> string
Float.toFixed(int) int -> string