Add comma_value function for pretty formatting big numbers (#1085)

This also applies the function to a number of labels in the skills window.
This commit is contained in:
Ascuas Funkeln
2020-05-05 18:39:11 +02:00
committed by GitHub
parent 63f5351016
commit 714c6b8fc0
2 changed files with 16 additions and 11 deletions

View File

@@ -8,4 +8,9 @@ function dirtostring(dir)
return k
end
end
end
end
function comma_value(n)
local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$')
return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right
end