title: WoW - rounding to two decimal places in Lua
body: <p>I'm trying to display my total experience points as a percentage rounded to two decimals. I have come up with a solution, but its quite clunky. There has to be a better way. </p>
  
  <p>Here is what I have:</p>
  
  <pre><code>local xpPercentage = (((UnitXP("player") / UnitXPMax("player"))*100))
  -- 63.4587392473
  local xpMantissa = xpPercentage - floor(xpPercentage)
  -- .4587392473
  local xpTwoDec = (floor(xpMantissa * 100)/100) + floor(xpPercentage)
  -- 63.45
  </code></pre>
  
  <p>Again, this does what I want, but is there a prettier way to do it?</p>