title: In Java, why does the decimal separator follow the Locale's language, not its country, and, more importantly, how does one override it?
body: <p>I'm working on an international project and have observed that, in Java, the choice of the decimal separator is based on the Locale's language, not its country. For example:</p>
  
  <pre><code>DecimalFormat currencyFormatter = (DecimalFormat) NumberFormat.getInstance(new Locale("it","IT"));
  System.out.println(currencyFormatter.format(-123456.78));
  
  currencyFormatter = (DecimalFormat) NumberFormat.getInstance(new Locale("en","IT"));
  System.out.println(currencyFormatter.format(-123456.78));
  </code></pre>
  
  <p>produces the following output:</p>
  
  <pre><code>-123.456,78
  -123,456.78
  </code></pre>
  
  <p>I would have expected it to follow the country, since if I'm in the country, whether I speak English or Italian the numbers in that country are written with the decimal separator as comma.</p>
  
  <p>My question is two-fold:</p>
  
  <ol>
  <li>Does anyone know why this behaviour follows the language?</li>
  <li>More importantly, can anyone offer details as to how to modify the default behaviour in Java to follow the language instead?</li>
  </ol>
  
  <p>Thanks.</p>