Changed get_daily_percentile function

Hi Ben, can you take a look on the changes I did?