My question is :
How do I make the program print the number of digits before the decimal point and how many comes after a number.
public class Strings {
public static void main(String args[])
{
double number = 17.0/3;
DecimalFormat number_format = new DecimalFormat("#.###");
System.out.println(number);
String formatted_string = number_format.format(number);
System.out.println(formatted_string);
}
}
I need the number of integers before decimal point
I need to get result of 1 and 3.