You can put this solution on YOUR website! Tax brackets or cab fares
Pay a set amount and then pay a percentage more for a certain amount after that until one reaches a new level and then pay more after that.
2.00 for the first 1/8 of a mile and then 50 cents per quarter mile afterwards would be piece-wise.