generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Club Houses » ROBLOX Talk
Home Search
 

Re: How to round numbers?

Previous Thread :: Next Thread 
ConfusedRabbit is not online. ConfusedRabbit
Joined: 06 Jan 2013
Total Posts: 194
08 Jan 2013 10:32 PM
this forum is more active than scripting helpers and has to do with roblox.


Through script, how can I round numbers?

Like, if I do...

script.Parent.Value = script.Parent.Value * 1.2

and started with 1, it would go into decimals. How can I round out of decimals?
Report Abuse
pwnedu46 is not online. pwnedu46
Joined: 23 May 2009
Total Posts: 7534
08 Jan 2013 10:33 PM
math.floor(number + 0.5)
Report Abuse
ConfusedRabbit is not online. ConfusedRabbit
Joined: 06 Jan 2013
Total Posts: 194
08 Jan 2013 10:33 PM
Is that it's own function or just to add?
Report Abuse
pwnedu46 is not online. pwnedu46
Joined: 23 May 2009
Total Posts: 7534
08 Jan 2013 10:34 PM
You could put it in a function to reuse if you really wanted to, but all you have to do is replace "number" with the number you want to round.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » ROBLOX Talk
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image