Number((2.935).toFixed(2)) //2.94
Number((12.349345).toFixed(4)) //12.2493
Number((2.5398).toFixed(3)) //2.540
Number((1.005).toFixed(2)) //outputs 1 instead of 1.01
Number((1.555).toFixed(2)) //outputs 1.55 instead of 1.56
function roundToTwo(num) {
return +(Math.round(num + "e+2") + "e-2");
}
console.log(roundToTwo(2.005));
a = 2.154327
a_2_decimal = "{:.2f}".format(a)
df.astype(int)
<=35 >35
Cut-off
Calcium 0 1
Copper 1 0
Helium 0 8
Hydrogen 0 1