MissouriTiger
Programmer
How can I limit the fractional decimal places of a double? I found an old post on this forum which suggests Math.round(). But that returns a long, which isn't even a floating point type. As a simple example, how might I limit the following output to 1 fractional decimal place?
System.out.print
(absoluteError = Math.abs(guessWt - realWt));
_______________________________________
Constructed from 100% recycled electrons
System.out.print
(absoluteError = Math.abs(guessWt - realWt));
_______________________________________
Constructed from 100% recycled electrons