fix bug in formatNumber