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: Need some help with Lua math.

Previous Thread :: Next Thread 
Mitko0o1 is not online. Mitko0o1
Joined: 30 Nov 2010
Total Posts: 5725
24 Aug 2014 10:05 AM
I'm not so good with using the Lua math functions/methods. Can someone explain me how can I make from, for an example, this large number - 1.3809320101490 a little bit smaller one - 1.3809. I know about math.floor but it just rounds the number and it'll make 1.
Report Abuse
Mitko0o1 is not online. Mitko0o1
Joined: 30 Nov 2010
Total Posts: 5725
24 Aug 2014 10:20 AM
B1
Report Abuse
Mitko0o1 is not online. Mitko0o1
Joined: 30 Nov 2010
Total Posts: 5725
24 Aug 2014 10:45 AM
Is it even possible do be done? Reply please!
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
24 Aug 2014 10:49 AM
use math.floor on it multiplied by 100 or whatever then divide by 100 or whatever, like this:

x = math.floor(1.234*100)/100
Report Abuse
IAmTheRolo is not online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
24 Aug 2014 10:52 AM
tonumber(('%.4f'):format(-1.3809320101490))

Where you can change the 4 to how many decimal places you want.
Report Abuse
Mitko0o1 is not online. Mitko0o1
Joined: 30 Nov 2010
Total Posts: 5725
24 Aug 2014 11:00 AM
It works! Thanks guys! This thing was messing with my leaderboard, but not any more.
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