You could use math.floor(x)
From the Lua Reference Manual:
Returns the largest integer smaller than or equal to x.
Related Posts:
- C: printf a float value
- C++: How to round a double to an int?
- Why does a float variable stop incrementing at 16777216 in C#?
- How to convert float number to Binary?
- Difference between decimal, float and double in .NET?
- Difference between decimal, float and double in .NET?
- Float and double datatype in Java
- can’t multiply sequence by non-int of type ‘float’
- Logitech/LGHUB Lua – Loop with break
- How do you round UP a number?
- How do you round UP a number?
- What is the difference between float and double?
- ValueError: could not convert string to float: id
- What is float in Java?
- Floating point exception (core dumped)
- Correct format specifier for double in printf
- (Python) TypeError: ‘float’ object is not subscriptable
- Floating Point Exception C++ Why and what is it?
- How do I parse a string to a float or int?
- Round a floating-point number down to the nearest integer?
- Limiting floats to two decimal points
- TypeError: ‘float’ object not iterable
- 1e-9 or -1e9, which one is correct?
- How to get a random number between a float range?
- How to deal with floating point number precision in JavaScript?
- Floating Point Exception C++ Why and what is it?
- Lua Program Delay
- Concatenation of strings in Lua
- Best way to generate a random float in C#
- Random float number generation
- Split a string using string.gmatch() in Lua
- Lua replacement for the % operator
- Inline conditions in Lua (a == b ? “yes” : “no”)?
- Lua string.format options
- How do I check if a string is a number (float)?
- How to remove a lua table entry by its key?
- C++ int float casting
- What is a good game engine that uses Lua?
- Python, print all floats to 2 decimal places in output
- “attempt to index a nil value”-error in Lua
- How to truncate float values?
- Creating a timer using Lua
- How can I convert integer into float in Java?
- How to add a “sleep” or “wait” to my Lua Script?
- What is the difference of pairs() vs. ipairs() in Lua?
- C convert floating point to int
- Numpy float64 vs Python float
- How to get number of entries in a Lua table?
- How to dump a table to console?
- Lua – if statement with two conditions on the same variable?
- Lua string to int
- Easy pretty printing of floats?
- Python: Converting string into decimal number
- Dealing with float precision in Javascript
- Lua read beginning of a string
- How to parse float with two decimal places in javascript?
- What do F and D mean at the end of numeric literals?
- Why does Lua have no “continue” statement?
- Using floats with sprintf() in embedded C
- Printf width specifier to maintain precision of floating-point value
- why f is placed after float values?
- Division of integers in Java
- Getting input from the user in Lua
- Does Lua have OR comparisons?
- Lua – Number to string behaviour
- Convert floats to ints in Pandas?
- Lua String replace
- How to convert string to float?
- Absolute value for floats in core OCaml
- How to iterate through table in Lua?
- Lua: Rounding numbers and then truncate
- How to math.floor to a decimal in Lua?
- Lua operators, why isn’t +=, -= and so on defined?
- C++ floating point to integer type conversions
- Is there a float input type in HTML5?
- How do I append to a table in Lua
- Value for epsilon in Python
- Convert float to double without losing precision
- Lua Semicolon Conventions
- Function to determine if two numbers are nearly equal when rounded to n significant decimal digits
- How to normalize a mantissa
- C++ float array initialization