title: How to display 12,4K with var NumberFollowers = 12458 in swift?
body: <p><strong>How to display 12,4K with the variable NumberFollowers = 12458 in swift ?</strong></p>
  <p>The number displayed (12,4K) should change value as soon as NumberFollower changes value.</p>
  <p>Example: if NumberFollowers is equal to 45875, the number displayed must be equal to 45,8K</p>
  <p>PS: I have a problem with the 12,4K comma.</p>
  <p><strong>This is what i want to display :</strong></p>
  <p>1234 -&gt; 1 234</p>
  <p>12345 -&gt; 12,3K</p>
  <p>123456 -&gt; 123K</p>
  <p>1234567 -&gt; 1,2M</p>
  <p>12345678 -&gt; 12,3M</p>
  <p>123456789 -&gt; 123M</p>
  <p><strong>Here is what I have</strong></p>
  <pre class="lang-swift prettyprint-override"><code>if NumberFollowers &gt; 999999 {
      NumberFollowersLabel.text = &quot;\(NumberFollowers/1000000) M&quot;
  } else if NumberFollowers &gt; 9999 {
      NumberFollowersLabel.text = &quot;\(NumberFollowers/1000) K&quot;
  } else {
      NumberFollowersLabel.text = &quot;\(NumberFollowers)&quot;
  }
  </code></pre>
  <p><strong>This is what my code displays</strong></p>
  <p>1234 -&gt; 1 234</p>
  <p>12345 -&gt; 12K</p>
  <p>123456 -&gt; 123K</p>
  <p>1234567 -&gt; 1M</p>
  <p>12345678 -&gt; 12M</p>
  <p>123456789 -&gt; 123M</p>