mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 09:48:52 +00:00
Added ESX.Math.*
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user