Leviticus 25:52

NASB
and if few years remain until the year of jubilee, he shall so calculate with him. In proportion to his years he is to refund the amount for his redemption.