Help with decimal numbers

Discussion in 'Plugin Development' started by SrNicks_, Jun 28, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    SrNicks_

    How to remove the numbers after the point in a decimal number?

    Example:
    b = 1.15
    He would remove the .15 and would be only 1
     
  2. cast it to int
     
  3. Offline

    Zombie_Striker

    You're using Ints/longs instead of Doubles. Either make the constructor a double or (if the constructor is a double) ad a cast to a double.

    [edit] Looking at your question again, it makes no sense. What do you want?
     
  4. Offline

    xTrollxDudex

  5. Offline

    Major_Derp

    Just floor it bro, not familiar with flooring in Java, but I would think it's just floor() or Math.floor() or something
     
  6. flooring is pretty much the same as casting to int
     
  7. Offline

    Major_Derp

    Basically lol
     
  8. Offline

    SrNicks_

    Solved thanks for helping.
     
Thread Status:
Not open for further replies.

Share This Page