Skip to content

Instantly share code, notes, and snippets.

@scriptschat
Created September 23, 2020 13:00
Embed
What would you like to do?
Multiplying numbers in JavaScript
function multiplyTest() {
var x = 0.1 * 0.2;
console.log(x);
}
multiplyTest();
//which might return an approximate answer like 0.020000000000000004
//this is a bad idea if we are dealing with $ or INR values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment