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 » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Rounding a decimal to the nearest whole number

Previous Thread :: Next Thread 
skate1011 is not online. skate1011
Joined: 13 Mar 2010
Total Posts: 688
23 May 2012 06:30 PM
I have this tool that makes a part wherever you click, but I am wondering, How I can have the position of the part round to the nearest whole number.
-Skate1011
Report Abuse
damanofrunescape is not online. damanofrunescape
Joined: 29 Jul 2008
Total Posts: 7338
23 May 2012 06:33 PM
You could use math.floor(num) to round to the lowest integer, or math.ceil(num) to round to the highest integer.
Report Abuse
skate1011 is not online. skate1011
Joined: 13 Mar 2010
Total Posts: 688
23 May 2012 07:16 PM
Thanks

-Skate1011
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
23 May 2012 08:52 PM
Better idea: set the part's FormFactor to 'Symmetrical'.

That'll make the position round automatically to integers.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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