Is there a way to dynamically format a float value?
I thought i could do something like this:
System.out.println(new BigDecimal(String.format("%" + k + "s", answer)).toPlainString());
Where k is the increments each time through a loop... however, this doesn't seem to do the trick...
i want the numbers to appear like this:
0.7897
0.78977
0.789778
0.7897789
any ideas?
substring.