program to count number of digits in javascript 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