Use the BB2 calculation formula.
For the more curious...
limit = 42; // Number of matches after which a threshold is reached and beyond which it is no longer very interesting to play.
played = wins + draws + losses
winPercentage = (wins + (draws / 2)) / played * 100
crossPoint = 0.2
a = 0.05
target = 28
x = Math.log(a / (1 - crossPoint)) / Math.log(1 - (target / limit))
points = winPercentage * (crossPoint + (1 - crossPoint) * (1 - Math.pow((1 - Math.min(limit, played) / limit), x)))