Okay, I just need to be able to display ONLY the decimal on a double number, and it must display every digit.
I thought about using DecimalFormat but I don't think it will allow me to display every digit without displaying zeros on some.
Example:
Input:
3.42
17.0
47.151
Code
DecimalFormat df = new DecimalFormat("?????.???");
I would have to find a way to take the whole integer portion of each double, and subtract it from the original
Printing doubles without DecimalFormat will do what I want about (display each decimal digit, while not showing zeros)
So, how would I go about assigning maybe the integer whole portion of each double to a int variable, and subtracting it.
Then, multiplying the decimal by 100 to change it to a whole number.
Keep in mind, I will not know what the input will be.
Correct Output:
42
0
151