Skip to content

Instantly share code, notes, and snippets.

@scriptschat
Created September 23, 2020 13:03
Embed
What would you like to do?
Solving number multiplication issue in JavaScript
function multiplyTest() {
var x = ((0.1 * 100) * (0.2 * 100)) / 10000;
console.log(x);
//We are dividing here with 10000 because we multiplye 2 different numbers with 100
//here console log statement will return exact answer 0.02
}
multiplyTest();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment