Added ESX.Math.*

This commit is contained in:
ElPumpo
2018-10-22 22:37:20 +02:00
parent 99bf793b96
commit 4c5d1532b2
13 changed files with 158 additions and 131 deletions
+12
View File
@@ -0,0 +1,12 @@
ESX.Math = {}
ESX.Math.Round = function(value, numDecimalPlaces)
return tonumber(string.format("%." .. (numDecimalPlaces or 0) .. "f", value))
end
-- credit http://richard.warburton.it
ESX.Math.GroupDigits = function(value)
local left,num,right = string.match(value,'^([^%d]*%d)(%d*)(.-)$')
return left..(num:reverse():gsub('(%d%d%d)','%1' .. _U('locale_digit_grouping_symbol')):reverse())..right
end