Hi every one,
Please tell me How to find No. of Digits in a number using java program?
Just count them; you can either do that numerically (divide by ten all the time)
or make a string out of that number and check the string length. These tips
should be enough for you to cook up a nice little method that does the job.
Just count them; you can either do that numerically (divide by ten all the time)
or make a string out of that number and check the string length. These tips
should be enough for you to cook up a nice little method that does the job.
kind regards,
Jos
Hi,
Thanks a lot. I used the (String.valueOf (num)).length() . Its working.
Comment