Description
Given an integer n, add a dot (".") as the thousands separator and return it as a string. For example, 1234567 becomes "1.234.567".
Examples
Input:
n = 987Output:
"987"Explanation:
No separator needed.
Input:
n = 0Output:
0Explanation:
Zero is a single digit, so no thousand separator is needed.
Input:
n = 50000Output:
50.000Explanation:
The number has 5 digits, so a dot separator is placed before the last 3 digits to separate thousands.
Constraints
- •
0 ≤ n ≤ 2³¹ - 1