Inconsistencies in SetFormattedText

by Kameril | 18/11/2007 09:26:10

Kameril

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
http://ctprofiles.net/81038

by Slouken | 20/11/2007 00:59:27

Slouken

Fixed for 2.3.2, thanks!

Blizzard Announcement Recent Blizzard Announcements

 



Loaded in 0.03804 seconds