I have a double number, and I want to print only an integral part of this number. I tried to print it using System.out.printf, but I got it IllegalFormatConversionException. I tried something like:
A()
{
double x;
System.out.println("%d",x);
}
I know that I can just print it with System.out.print, but will also print the decimal part. How to do this using printf?
source
share