From ESOUI Wiki
This function returns the number of experience points needed to level up from the specified level. If you specify the maximum level, or a level outside of the range of valid levels, then this function returns nil.
To be clear: this is the number of experience points that a character would need to gain in order to level up from the specified level, not the cumulative experience points that they need to have.
local level = GetUnitLevel("player") local xp = GetNumExperiencePointsInLevel(xp) if not xp then d("You can't level up any further.") else d("It takes " .. xp .. " XP to get from the start of this level to the next level.") end