summaryrefslogtreecommitdiff
path: root/core/src/com/ilotterytea/maxoning/utils
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/com/ilotterytea/maxoning/utils')
-rw-r--r--core/src/com/ilotterytea/maxoning/utils/math/Math.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/src/com/ilotterytea/maxoning/utils/math/Math.java b/core/src/com/ilotterytea/maxoning/utils/math/Math.java
index 0bb8aa8..0c32a89 100644
--- a/core/src/com/ilotterytea/maxoning/utils/math/Math.java
+++ b/core/src/com/ilotterytea/maxoning/utils/math/Math.java
@@ -10,4 +10,8 @@ public class Math {
public static int getRandomNumber(int min, int max) {
return (int) ((java.lang.Math.random() * (max - min)) + min);
}
+
+ public static float percentFromValue(float percentage, int value) {
+ return percentage / 100f * value;
+ }
}