showing results for - "react native float upto 2 digits"
Greta
03 Apr 2019
1Use Math.round(num * 100) / 100
2
3Edit: to ensure things like 1.005 round correctly, we use
4
5Math.round((num + Number.EPSILON) * 100) / 100