title: How to convert 2k,1m,1g etc to 2000, 1000000 etc
body: <p>Hello I'm new to java can anyone help me?</p>
  
  <p>This code convert 
  2000 to 2k and 1000000 1m etc </p>
  
  <pre><code> private static final NavigableMap&lt;Long, String&gt; suffixes = new TreeMap&lt;&gt;();
      static {
          suffixes.put(1_000L, "k");
          suffixes.put(1_000_000L, "M");
          suffixes.put(1_000_000_000L, "G");
          suffixes.put(1_000_000_000_000L, "T");
          suffixes.put(1_000_000_000_000_000L, "P");
          suffixes.put(1_000_000_000_000_000_000L, "E");
      }
  
      public String format(long value) {
          //Long.MIN_VALUE == -Long.MIN_VALUE so we need an adjustment here
          if (value == Long.MIN_VALUE) return format(Long.MIN_VALUE + 1);
          if (value &lt; 0) return "-" + format(-value);
          if (value &lt; 1000) return Long.toString(value); //deal with easy case
  
          Map.Entry&lt;Long, String&gt; e = suffixes.floorEntry(value);
          Long divideBy = e.getKey();
          String suffix = e.getValue();
  
          long truncated = value / (divideBy / 10); //the number part of the output times 10
          boolean hasDecimal = truncated &lt; 100 &amp;&amp; (truncated / 10d) != (truncated / 10);
          return hasDecimal ? (truncated / 10d) + suffix : (truncated / 10) + suffix;
      }
  </code></pre>
  
  <p>I need a code which reverse the conversion for example 
  2k to 2000 and 1m to 1000000</p>