• 0

    posted a message on Help: When my restedXp is zero my code does not return 0

    Custom code from my weakaura:

     

    function ()
      local totalXP = UnitXPMax("player")
      local restedXP = GetXPExhaustion()
      local percentrested = ((restedXP / totalXP) * 100)
      local rested = percentrested - floor(percentrested)
      local twodec = (floor(rested * 100)/100) + floor(percentrested)
      return twodec
    end

     

    I would like it to return "0" instead of just a blank "" when my characters rested experience is zero. Suggestions?

    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.