Originally Posted by Rainrider
Code:
fontString:SetText(format(t[3], value/t[2]):gsub("%.", " , "))
(this would also add spaces before and after the decimal seperator)
|
Using string functions as metamethods is the slowest possible way to use them. Do this instead:
Code:
fontString:SetText(gsub(format(t[3], value / t[2]), "%.", " , "))
Also, if you're going to be using
format directly instead of letting
SetFormattedText handle it, you should upvalue
format, since
TextStatusBar_UpdateTextStringWithValues can be called quite often. Add this at the top of your file, outside of any function:
Code:
local format, gsub = format, gsub
This creates local references to these global functions, so when you call
format later, your code is using the faster local reference, instead of a slower global lookup.