How do I turn the experierce that is given to a level?

I know the function ConvertXPToLevel, but that one doesn't work correctly =/

Thanks for your time!