var total = 67.9;
something to process var whole var DEC to be like
var whole = 67;
var DEC = 9;
The simplest way I can think of is this:
var string = total.toString(); var dotidx = string.indexOf("."); var dec = dotidx >= 0 ? +string.slice(dotidx + 1) : 0;
Notice that it doesn't work with numbers in exponential forms.