about | help | code help+videos | done | prefs |
separateThousands
Given a number as a string, introduce commas to separate thousands. The number may contain an optional minus sign, and an optional decimal part. There will not be any superfluous leading zeroes. separateThousands("1000") → "1,000" separateThousands("-12345") → "-12,345" separateThousands("-1234567890.1234567890") → "-1,234,567,890.1234567890" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 800
Copyright Nick Parlante 2017 - privacy