Originally Posted by Mikord
For shortening and rounding the numbers, would you guys prefer the nearest thousand or nearest hundred?
For example, 32,765 becomes 33k (nearest thousand) or 32.8k (nearest hundred)?
|
this is the code i'm using
Code:
lib.siValue = function(val)
if(val >= 1e6) then
return ('%.1f'):format(val / 1e6):gsub('%.', 'm')
elseif(val >= 1e4) then
return ("%.1f"):format(val / 1e3):gsub('%.', 'k')
else
return val
end
end
so i prefer the nearest hundred
would be awesome if the string format could be user-defined instead of fixated. I don't know how complicated would be that anyway