Function to calculate cents per mile for award tickets (JS version)