JavaScript: Thousands separator function

Reply to comment

Note this will break if the number has more than three decimal places!