2022-03-27 20:37:52 +08:00
|
|
|
<p>Given an integer <code>n</code>, add a dot (".") as the thousands separator and return it in string format.</p>
|
|
|
|
|
|
|
|
<p> </p>
|
2023-12-09 18:42:21 +08:00
|
|
|
<p><strong class="example">Example 1:</strong></p>
|
2022-03-27 20:37:52 +08:00
|
|
|
|
|
|
|
<pre>
|
|
|
|
<strong>Input:</strong> n = 987
|
|
|
|
<strong>Output:</strong> "987"
|
|
|
|
</pre>
|
|
|
|
|
2023-12-09 18:42:21 +08:00
|
|
|
<p><strong class="example">Example 2:</strong></p>
|
2022-03-27 20:37:52 +08:00
|
|
|
|
|
|
|
<pre>
|
|
|
|
<strong>Input:</strong> n = 1234
|
|
|
|
<strong>Output:</strong> "1.234"
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
<p><strong>Constraints:</strong></p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li><code>0 <= n <= 2<sup>31</sup> - 1</code></li>
|
|
|
|
</ul>
|