of     1   

Alypia
#228360454Sunday, December 03, 2017 2:49 AM GMT

Hey Scripters, I can't find any information on such a simple question. I need to round the exact values of my variables. The reason because, I need to get the X, Y, and Z positions of a part, and then get them a second time after .1 seconds. If the two calculations are similar (ie; the part is near stationary,) then an event will fire. Due to the physics engine, the exact value of X, Y, and Z, added together, will constantly change, even if the part is seemingly "stationary." The values tend to rapidly change after the one hundredth of a decimal place, so I ideally need to round my values to the nearest one hundredth. How do I round values? ⚜ 𝕬𝖑𝖞𝖕𝖎𝖆
128Gigabytes
#228360567Sunday, December 03, 2017 2:53 AM GMT

math.floor(x) will round x down math.ceil(x) will round x up math.floor(x + 0.5) will round x
BeatableChicken
#228360630Sunday, December 03, 2017 2:54 AM GMT

number = 1.543565 print(round(number, 2)) # outputs 1.54
Alypia
#228360863Sunday, December 03, 2017 3:01 AM GMT

Thank you, Gigabytes. ⚜ 𝕬𝖑𝖞𝖕𝖎𝖆
BeatableChicken
#228360877Sunday, December 03, 2017 3:01 AM GMT

Arent you gonna thank me /s
Alypia
#228360939Sunday, December 03, 2017 3:03 AM GMT

I would thank you Beatable, if I was using Python, but I'm using Lua... Lmao ⚜ 𝕬𝖑𝖞𝖕𝖎𝖆
BeatableChicken
#228361057Sunday, December 03, 2017 3:06 AM GMT

Who said anything about Lua...
Alypia
#228361221Sunday, December 03, 2017 3:10 AM GMT

You're not wrong... >_> ⚜ 𝕬𝖑𝖞𝖕𝖎𝖆
joshxie
#228362223Sunday, December 03, 2017 3:42 AM GMT

roblox uses lua if you asked on a scripting forum on roblox, which uses lua, it's pretty clear you're asking for lua
BeatableChicken
#228362653Sunday, December 03, 2017 3:53 AM GMT

No where on this subforum rules or op's thread does it say anything about lua. She could be talking about Ruby for all i know.
joshxie
#228362729Sunday, December 03, 2017 3:55 AM GMT

you silly goose, she's talking about objective-c
Disillusions
#228362948Sunday, December 03, 2017 4:00 AM GMT

rules say for roblox scripting dummy
BeatableChicken
#228363029Sunday, December 03, 2017 4:03 AM GMT

no, there is no way shes not talking about baisc
BeatableChicken
#228363063Sunday, December 03, 2017 4:04 AM GMT

on second thought it seems as she is talking about go
Dollar500
#228363146Sunday, December 03, 2017 4:06 AM GMT

If you want to round to a decimal place you can do this: math.ceil(Value * 10) / 10
BeatableChicken
#228363168Sunday, December 03, 2017 4:07 AM GMT

could also be rust
Alypia
#228364923Sunday, December 03, 2017 5:06 AM GMT

1) Why are there still replies here? Lmao 2) @Beatable; In my original post, I said: "Due to the physics engine, the exact value of X, Y, and Z, added together, will constantly change, even if the part is seemingly "stationary."" Last time I checked, Python coding from scratch, didn't have a built-in physics engine. It's not like I just asked how to round a value, and nothing else. ⚜ 𝕬𝖑𝖞𝖕𝖎𝖆
Alypia
#228364963Sunday, December 03, 2017 5:07 AM GMT

@Dollar: Thank you very much! ⚜ 𝕬𝖑𝖞𝖕𝖎𝖆
SwagCuzYolo
#228365796Sunday, December 03, 2017 5:36 AM GMT

chicken ur so lame

    of     1