Thread: Math Help
View Single Post
01-30-12, 06:43 AM   #45
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Originally Posted by Grimsin View Post
btw i found this function on wowwiki. It worked perfectly.

Code:
function truncate(number, decimals)
    return number - (number % (0.1 ^ decimals))
end
I think you can even use this function to truncate, just don't ask about performance comparison between these two -the one here is probably milliseconds slower:
Code:
function truncate(number, decimals)
    return format("%."..decimals.."f", number)
end
Originally Posted by Torhal View Post
Don't you mean WoWPedia?
Probably, not all noticed the change, that the old wowwiki team left and made wowpedia under curse, many still use wowwiki because tbh, the transition was somewhat ninja-like...
  Reply With Quote