Code

backport from 1.4 round the index of the PERCENT selected element