title: How can I format a double for currency using Formatter on BlackBerry?
body: <p>I have a need to display a currency value in my application. There doesn't seem to be an easy way to do this with the RIM API, so I'm reduced to creating my own solution (a common refrain for BlackBerry development, unfortunately)</p>
  
  <p>Currently I'm using the <code>Formatter</code> class, from <code>javax.microedition.locale</code> like so</p>
  
  <pre><code>protected String formatResult(double result)
  {
    try {
       Locale l = Locale.getDefaultForSystem();
       Formatter formatter = new Formatter(l.toString());
       return formatter.formatCurrency(result);
    } catch (UnsupportedLocaleException e)
    {
       return "This fails for the default locale because BlackBerry sucks";
    }      
  }
  </code></pre>
  
  <p>I <strong>always</strong> hit the <code>catch</code> block in the simulator. Since this doesn't work by default on the simulator, I'm hesitant to put it in the application.</p>
  
  <p>Can anyone tell me if the above solution is the way to go? And how to fix it, of course.</p>