Add a function to calculate the percentile rank of a value in an array.