1.2.0, fixes #1
This commit is contained in:
21
src/main/java/hu/ditservices/utils/Math.java
Normal file
21
src/main/java/hu/ditservices/utils/Math.java
Normal file
@ -0,0 +1,21 @@
|
||||
package hu.ditservices.utils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Math {
|
||||
public enum Convert {
|
||||
TICKS,SECONDS,MINUTES,HOURS
|
||||
}
|
||||
/**
|
||||
* Converting time measurement units from one to another.
|
||||
* @param from The unit FROM you want to convert. Math.Convert
|
||||
* @param to The unit TO you want to convert. Math.Convert
|
||||
* @param value An integer which you want to convert.
|
||||
*/
|
||||
public static long convert(Convert from, Convert to, int value){
|
||||
if (from== Convert.SECONDS && to==Convert.TICKS){
|
||||
return value*20L;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user