diff options
| author | ilotterytea <iltsu@alright.party> | 2024-04-28 13:02:53 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-04-28 13:02:53 +0500 |
| commit | 88a5952948e20fdf94534e4cafecce5bc5b0fdbb (patch) | |
| tree | 26f01226e698344179b18a01b4aafe07361cbefd /core | |
| parent | ab91d529378c3708eb5757b098900983bf4294b1 (diff) | |
feat: percentFromValue method
Diffstat (limited to 'core')
| -rw-r--r-- | core/src/com/ilotterytea/maxoning/utils/math/Math.java | 4 |
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; + } } |
