W
www
Hi,
My code has:
System.out.printf("%10.7f", aDouble);
My intention is to print out the value of a double variable following
the rule: a)the maximum space is 10; b)have 7 digits after the decimal
point.
But there is a bug here, I found. If aDouble < 100, it is fine; If
aDouble >= 100, it will take 11 spaces, instead of 10 spaces. So I have
to manually change 10.7f to 10.6f. What a pain!
Could you help me out? Thank you.
My code has:
System.out.printf("%10.7f", aDouble);
My intention is to print out the value of a double variable following
the rule: a)the maximum space is 10; b)have 7 digits after the decimal
point.
But there is a bug here, I found. If aDouble < 100, it is fine; If
aDouble >= 100, it will take 11 spaces, instead of 10 spaces. So I have
to manually change 10.7f to 10.6f. What a pain!
Could you help me out? Thank you.