let price: number = 0.7; // $
let discountPrice: number = 0.6; // $
let netPrice: number = price - discountPrice;
console.log(netPrice); // 0.09999999999999998 but not 1 cent
Due to IEEE 754 standard, we are losing data precision after computation.
How client side calculations are done in ecommerce applications? to maintain precision