title: Is String.format %d always compatible with BigInteger?
body: <p>With <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#format(java.lang.String,%20java.lang.Object...)" rel="noreferrer">String.format</a> %d and its variants, we can easily format primitive integers and longs. However, does these formatting options work perfectly with BigInteger?</p>
  
  <p>I've made some tests, and they seem to work well, for example:</p>
  
  <pre><code>public class Test6 {
      public static void main(final String args[]) {
          final java.math.BigInteger b = java.math.BigInteger.TEN.pow(999999);
          System.out.println(String.format("%,d", b));
      }
  }
  </code></pre>
  
  <p>But are there any gotchas to watch out for?</p>