formatPercent function

Format a numeric proportion.