c - Get number of digits of a number -


i have number this: int num = 36729; , want number of digits compose number (in case 5 digits).

how can this?

use formula:

if(num)   return floor(log10(abs((double) num)) + 1);  return 1; 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -