title: Remove decimal places without rounding
body: <p>I have a function that converts 60000 into 60k or 60100 into 60.1k</p>
  
  <p>But if I was to put in for instance 60123, it would output 60.123k</p>
  
  <p>How do I make it output 60.1k without it rounding up like it does for number_format.</p>
  
  <p>EDIT: Here is my function that does the converting</p>
  
  <pre><code>function format($val) {
  $letter = "";
  while ($val &gt;= 1000) {
  $val /= 1000;
  $letter .= "K";
  }
  $letter = str_replace("KKKK", "000B", $letter);
  $letter = str_replace("KKK", "B", $letter);
  $letter = str_replace("KK", "M", $letter);
  return $val.$letter;
  }
  </code></pre>
  
  <p>Here is what I put to echo out</p>
  
  <pre><code>echo format(1)."&lt;br&gt;";
  echo format(123548)."&lt;br&gt;";
  echo format(1000000)."&lt;br&gt;";
  echo format(1000000000)."&lt;br&gt;";
  echo format(1200000000)."&lt;br&gt;";
  </code></pre>
  
  <p>And here is the output:</p>
  
  <p>1<br>
  123.548K<br>
  1M<br>
  1B<br>
  1.2B</p>
  
  <p>For the 123.548K, I want it to just be "123.5K"</p>