Roy2992
(Roy2992)
January 22, 2024, 6:17pm
1
I am trying to make a drop rate system but when I use the function that pseudo-randomly gives me a float it gives me a very long float and I would like to keep it in 2 digits but I don’t know how
I’m not sure if this is possible, but I know of the Ceil and Floor methods that can round floats up or down to the nearest whole digit
Roy2992
(Roy2992)
January 23, 2024, 8:04pm
3
yeah, i founded but i don’t know how to use this method
EisStudios
(EisStudios)
January 23, 2024, 8:18pm
4
This post should answer your question
@ChrisAI
This mostly comes down to a problem of converting between ints and floats in Verse. One thing you might have been missing is that you can multiply an int by 1.0 to turn it into a float. Here is a version of your original code with that + rounding integrated in.
QuickTest():logic =
if:
((Round[10.12345 * 1000.0] * 1.0) / 1000.0) = 10.123
then:
return true
else:
return false
I also gave a quick go at writing a more generic version
RoundToDecimalPlac…
system
(system)
Closed
February 22, 2024, 8:18pm
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.