How can I find the length of a number?

I’m looking to get the length of a number in JavaScript or jQuery?

I’ve tried value.length without any success, do I need to convert this to a string first?

Answer

var x = 1234567;

x.toString().length;

This process will also work forFloat Number and for Exponential number also.