Jump to content

little question


Fury

Recommended Posts

Posted

hey there, i have a list something like that;

2132.1 
1615.121 
564165.122 
.. 
.. 

what i want is to delete numbers after the dot "." so it'll be something like this;

2132 
1615 
564165 
.. 
.. 

i can find the data's who have dots in it with string.find, but how can i delete them? the number's count after the dot is different for each data. so thanks for helping from now.

  • Moderators
Posted
You can use math.ceil or math.floor to round numbers.

thank you, math.ceil works for me. :)

Both would work, but math.ceil will round up the float number and math.floor will round it down:

math.floor(5.2) --> 5 
math.floor(5.9) --> 5 
  
math.ceil(5.2) --> 6 
math.ceil(5.9) --> 6 

Regards,

Citizen

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...