title: Java: Synchronization issue with NumberFormat?
body: <p>I use java.text.NumberFormat simply to convert numbers into more readable Strings, with commas separating thousands, etc.  Basically I define it as:</p>
  
  <pre><code>public static NumberFormat nf = NumberFormat.getInstance(Locale.US);
  </code></pre>
  
  <p>...and then I just call nf.format(some_number) in any thread where I want to make a readable version of a number.  But looking at the JavaDoc, it says: "Number formats are generally not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally."</p>
  
  <p>If I am only using the format(number) method of the NumberFormat object, could there ever be a synchronization issue?  I tried using NumberFormat.getInstance(Locale.US).format(number) instead, but there is overhead associated with doing that every time that I feel is probably not really needed.  Does this really need external synchronization?  Or is there a simpler, efficient way of accomplishing the same thing without NumberFormat?</p>
  
  <p>Thanks!</p>