Answers for "digit count in javascript"

0

digit count in javascript

function digitCount(num) {
  if(num === 0 ) return 1
  return Math.floor(Math.log10(Math.abs(num))) + 1
}
Posted by: Guest on October-03-2020
2

javascript count digits

var length = (number + '').replace('.', '').replace('-', '').length;  // for numbers that can be floats or negatives
Posted by: Guest on August-21-2020

Code answers related to "digit count in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language