• 0

[Java] Round off a double


Question

I got a program that turns out math answer. The answer is 678.617475728155

But I want to to have 7 digits after the dot. Like: 678.6174757

I got this code:

Math.floor(n + 0.7d);

n is the var with the answer. But It's not working? I stil get the whole answer after the math.floor

Anyone knows why?

grtz

Speedy

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.