Thread: counting digits
View Single Post
Old Apr 10th, 2007, 10:53 AM   #5
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
hey sweet!

ok so obviously using log10 - i would have to use the ceiling function?

for example, say our integer is 235, log10 returns 2.37 - and there are actually 3 numbers in the integer, so use celing(2.37) to get 3...

that right?
rwm is offline   Reply With Quote