title: Java Converting long into currency
body: <p>I am having trouble converting a long (cents) into currency format.</p>
  
  <p>My Code: </p>
  
  <pre><code>long doublePayment = 1099;  //Should equal $10.99
  DecimalFormat dFormat = new DecimalFormat();
  String formattedString = dFormat.format(doublePayment);
  System.out.println(formattedString);
  </code></pre>
  
  <p>Output:  1,099</p>
  
  <p>I also tried:</p>
  
  <pre><code>long doublePayment = 1099;
  NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US); 
  String s = n.format(doublePayment);
  System.out.println(s);
  </code></pre>
  
  <p>Since this is cents, the output should be 10.99 or $10.99.</p>
  
  <p>Cant figure out what I am doing wrong. Thanks!!!</p>