Right now I'm using something like this: Basically the program is supposed to print X (right most digit of a #) to X decimal places for example:
- entered 3.56, should display 0000000000000003.560
- entered 56.7 should display: 000000000056.700000
- entering 1002.5 should display 00000000000001002.50
but number % 10
,condition right now only accepts number
w/o decimals, so the program closes if i enter
a number with decimals
I only need an alternative for number % 10
.
double number;
if (number % 10 == 1)
System.out.printf("%020.1f\n",number);