added truncate method

main
Simon Kellet 3 months ago
parent e47799650a
commit 7af90632fd
  1. 6
      truncate.lua

@ -0,0 +1,6 @@
function truncate(number, decdigits)
number = number * (10 ^ decdigits)
number = math.floor(number)
number = number / (10 ^ decdigits)
return number
end
Loading…
Cancel
Save