Image

Imagethe_tara wrote in Imagejava_dev

Quick question

Hello all, just a quick question here...

You know how when one restricts the number of decimal places shown, it always rounds UP? Is there any way to make it round DOWN?

Thanks

Edit -- oh hang on... maybe "double Math.floor( double );" <--something along those lines will work. Am I on the right track?

Edit #2 -- I seem to have got it working, but only because I tried something new that I wasn't sure would work, but it did. However I'm still not sure if I'm technically correct here.

df.format(Math.floor(change2))

is what I did. Am I "allowed" to put decimal format around math like that? (I hope I'm making sense)