how to get number of digits in a number js code example
Example: javascript count digits
var length = (number + '').replace('.', '').replace('-', '').length; // for numbers that can be floats or negatives
var length = (number + '').replace('.', '').replace('-', '').length; // for numbers that can be floats or negatives