Thousand Separator - Practice Coding | SlaveCode
Problems
Scratchpad
Run
Submit
0
0
1
2
3
4
5
6
7
8
9
0
0
1
2
3
4
5
6
7
8
9
:
0
0
1
2
3
4
5
6
7
8
9
0
0
1
2
3
4
5
6
7
8
9
Toggle theme (Current: Custom)
Scratchpad
Run
Submit
Description
Hints
Solutions
1556. Thousand Separator
Easy
10 Points
String
Given an integer n, add a dot (".") as the thousands separator and return it in string format.
Examples
Example 1
Input: n = 987 Output: "987"
Example 2
Input: n = 1234 Output: "1.234"
Constraints
0 <= n <= 231 - 1
JAVASCRIPT
Code
Tests
Result
Description
Hints
Solutions
1556. Thousand Separator
Easy
10 Points
String
Given an integer n, add a dot (".") as the thousands separator and return it in string format.
Examples
Example 1
Input: n = 987 Output: "987"
Example 2
Input: n = 1234 Output: "1.234"
Constraints
0 <= n <= 231 - 1
JAVASCRIPT
Code
Tests
Result