Solved calculate way.

Discussion in 'Spigot Plugin Development' started by xLeZx, Jan 12, 2020.

Thread Status:
Not open for further replies.
  1. hello.
    i want a way to calculate much of numbers, but idk how i'm bad with math.
    lets make a
    g=3
    and i have 2.5 and 1.5 and 4.5.
    g is 3 because i have 3 numbers.
    so what is the calculate way to make a final number is 100.0
    the differences between numbers is 0.5.
    so i mean 4.5 is maybe 65.0
    and 2.5 is 20
    and 1.5 is 15.
     
    • Creative Creative x 1
  2. int final = 100;
    This makes no sense
     
    • Winner Winner x 1
  3. [​IMG]
     
    • Funny Funny x 1
  4. i want it like percent
     
  5. .-.
     
  6. Strahan

    Benefactor

    I have no idea what your original post is saying, but if you want a percentage take (unit value * 100) / maximum value. So if your number is 4.5 and the total value of whatever that number signifies is like 20, you'd get the percentage via (4.5 * 100) / 20 which is 450 / 20 which is 22.5 percent.
     
  7. thanks
     
Thread Status:
Not open for further replies.