Make sure numberFormat is working with numbers

numberFormat would accept a numeric string, but would fail on toFixed. This change makes sure we are dealing with a number.