SyntaxFix
Write A Post
Hire A Developer
Questions
var decimal = n - Math.floor(n)
Although this won't work for minus numbers so we might have to do
n = Math.abs(n); // Change to positive var decimal = n - Math.floor(n)