Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript number length

export function numberLength(number) {
	let length = 0;
	let n = Math.abs(number);
	do {
		n /= 10;
		length++;
	} while (n >= 1);
	return length;
}

export default numberLength;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #number #length
ADD COMMENT
Topic
Name
6+2 =