mirror of
https://github.com/edubart/otclient.git
synced 2025-10-20 14:33:26 +02:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user