java the number of digits in a number

java the number of digits in a number
‮er‬fer to:lautturi.com
/**
 * @author lautturi.com
 * Java example: the number of digits in a integer
 */

import java.util.*;

public class Lautturi {
	
	public static void main(String[] args) {

		int number = 123456; 
		int len = (int) (Math.log10(number) + 1);

		System.out.println(len);
		
	}
}
Created Time:2017-09-11 23:42:29  Author:lautturi