You can then also get rid of this if-else statement, and just call formatNumber.