playMaker
Home
Store
Showcase
Tutorials
Forums
Manual
Wiki
About Us
Playmaker Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Join our
Discord Channel
Home
Help
Search
Login
Register
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
(Moderator:
600
) »
Round float to nearest divisible[SOLVED]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Round float to nearest divisible[SOLVED] (Read 850 times)
Mupp
Full Member
Posts: 167
Round float to nearest divisible[SOLVED]
«
on:
April 01, 2021, 05:23:43 PM »
I'm looking for a way to round a float to nearest divisible by X and it should work for both positive and negative floats. How can I do that?
«
Last Edit: April 08, 2021, 04:26:38 AM by jeanfabre
»
Logged
Alex Chouls
Administrator
Hero Member
Posts: 4002
Official Playmaker Support
Re: Round float to nearest divisible
«
Reply #1 on:
April 01, 2021, 06:39:43 PM »
There should be actions on the ecosystem for this. Search for Float Round or Ceiling/Floor if you want to round up/down.
Logged
Mupp
Full Member
Posts: 167
Re: Round float to nearest divisible
«
Reply #2 on:
April 01, 2021, 07:24:34 PM »
Thanks, I thought float round worked in a completely different way...
Logged
Alex Chouls
Administrator
Hero Member
Posts: 4002
Official Playmaker Support
Re: Round float to nearest divisible
«
Reply #3 on:
April 01, 2021, 09:19:25 PM »
Actually, you're right, I misread your question. Round just rounds to the nearest whole number.
What you want is a little more complicated! I'll have to get back to you after I take a look at the ecosystem...
Logged
Alex Chouls
Administrator
Hero Member
Posts: 4002
Official Playmaker Support
Re: Round float to nearest divisible
«
Reply #4 on:
April 01, 2021, 09:25:40 PM »
What you want is probably Float Round To Nearest (on the Ecosystem).
Logged
Mupp
Full Member
Posts: 167
Re: Round float to nearest divisible
«
Reply #5 on:
April 02, 2021, 09:30:03 AM »
Got it, thanks.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
(Moderator:
600
) »
Round float to nearest divisible[SOLVED]