1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

NumberFormatException maybe yes maybe no

Discussion in 'Java' started by LeoPelo, Mar 26, 2009.

  1. LeoPelo

    LeoPelo New Member

    Mar 26, 2009
    Likes Received:
    Trophy Points:
    I have to work on a test machine and when my work is complete and tested, I have to put it online for customers.

    On these two machines my code doesn't work in different ways!

    This part is the problem:

    public void setQntaRiduAsDecimalQuantityString(String qntaRidu) {
    Double pippo=new Double(qntaRidu.replace(',','.'));
    catch(NumberFormatException x)

    On test machine i have String qntaRidu = 42,123 (with comma).
    All goes ok and pippo gets 42.123

    On "Online" machine the same code, and same value in qntaRidu , cast a NumberFormatException.

    In java, is number format customizable ? (for example in Oracle you can localize your machine, so you can choose to have comma as decimal separator instead of dot.)

    Thanks for help (i work with oc4j

Share This Page