From 25124cef972e3e6633519464354f6be56f113416 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Tue, 6 Dec 2011 21:08:45 +0000 Subject: [PATCH] Avoid IEEE-754 precision issues --- TomTom.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/TomTom.lua b/TomTom.lua index f820f68..48c4ec1 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -193,7 +193,13 @@ function TomTom:GetKeyArgs(m, f, x, y, title) f = floors == 0 and 0 or 1 end - return string.format("%d:%d:%d:%d:%s", m, f, x*10e8, y*10e8, tostring(title)) + -- Fudge the x/y values so they avoid precision/printf issues + local x = x * 10000 + local y = y * 10000 + + local key = string.format("%d:%d:%d:%d:%s", m, f, x*10e4, y*10e4, tostring(title)) + print(key) + return key end local flipFixFrame = CreateFrame("Frame", "TomTomMapFlipFixFrame", UIParent) -- 1.7.9.5