diff --git a/Themes/_fallback/Scripts/03 ProductivityHelpers.lua b/Themes/_fallback/Scripts/03 ProductivityHelpers.lua index 41942df216..800303f672 100644 --- a/Themes/_fallback/Scripts/03 ProductivityHelpers.lua +++ b/Themes/_fallback/Scripts/03 ProductivityHelpers.lua @@ -241,5 +241,12 @@ function pname(pn) return ToEnumShortString(pn) end +function math.round(num, pre) + if pre and pre < 0 then pre = 0 end + local mult = 10^(pre or 0) + if num >= 0 then return math.floor(num*mult+.5)/mult + else return math.ceil(num*mult-.5)/mult end +end + --[[ end helper functions ]] --- this code is in the public domain. \ No newline at end of file +-- this code is in the public domain.