I don't think there is a point for this decimalNumberSample var here. You should pass the formatter.formatNumber(...) directly