1.1.0 • Published 2 years ago
float-calculator v1.1.0
Result when performing with float-calculator
mathCalculation("+",5.33, 5.2 ) === 10.53
mathCalculation("-",8.13, 5.75 ) === 2.38
mathCalculation("*",8.38, 0.3) === 2.514
mathCalculation("/",4.2, 1.2 )=== 3.5
Why you need it? if you're dealing with sensitive stuff like monetary transactions, and you don't need to lose the last digits of numbers with methods like toFixed().
import mathCalculation from "float-calculator";
mathCalculation("+",1.2,2,3)
mathCalculation("-",1.2,2,3)
mathCalculation("*",1.2,2,3)
mathCalculation("/",1.2,2,3)