Inconsistencies in SetFormattedText

#0 - Nov. 18, 2007, 9:26 a.m.
Blizzard Post
It seems they disagree on rounding. Obviously flooring the float would solve the problem but it seems to me it should be consistent with Lua's string.format regardless.

local function print(msg)
DEFAULT_CHAT_FRAME:AddMessage(msg)
end

local fs = CreateFrame("Frame"):CreateFontString()
fs:SetFontObject("GameFontNormal")

function TestFormats(float)
print(format("%d", float))
fs:SetFormattedText("%d", float)
print(fs:GetText())
end

TestFormats(.4) => 0, 0 as expected
TestFormats(.6) => 0, 1 SetFormattedText rounds up
#3 - Nov. 20, 2007, 12:59 a.m.
Blizzard Post
Fixed for 2.3.2, thanks!