Fix js bug in toLocaleString call