I’m trying to print a number with digits after the decimal point, but i want to show just one digit.
ratio = (double) comparisons / arrayLength;
(while ratio is double and comparisons , arrayLength
is int
).
i'm doing the calculation in one class and add the result to a string
(when later is returned from a method), and doing the printing in a test class.
i need to change ratio and not allowed to use printf
in the test class.
thanks for your help