Add a newer math helper

This commit is contained in:
Zontreck 2024-02-11 21:55:30 -07:00
parent 3d50d8f4ec
commit c34294c48c
3 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,18 @@
package dev.zontreck.ariaslib.util;
/**
* This class will be used to house math helper functions
*/
public class MathUtil
{
/**
* A newer helper function to get the percentage with large number support
* @param current Min value
* @param max Maximum value for progress
* @return Percentage
*/
public static int getPercent(long current, long max)
{
return Math.round(current*100/max);
}
}

View file

@ -2,6 +2,7 @@ package dev.zontreck.ariaslib.util;
import java.io.PrintStream;
@Deprecated
public class Percent
{
int current;

View file

@ -2,6 +2,7 @@ package dev.zontreck.ariaslib.util;
import java.util.concurrent.atomic.AtomicInteger;
@Deprecated
public class Progress
{
private int maximum;