Users - numberformatexception - ". ,"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Users - numberformatexception - ". ,"

Schreibmaier Joachim
Hi,

I have the following problem with the calculation of the invoices.

The comma separator of my application should be the "," instead of "."

In the general.properties file I the currency.decimal.format is ##.###,##

When I try to lookup the invoices and process the payments I get the
following error:
Java.lang.NumberFormatException: For input string: "335,4".

I have also the problem in the Inventory Receive method. But if I manually
change the unit price from "50,00" to "50.00" it works.

It doesn't bother us if we use a point or comma as value separator the main
point the application runs without problems.

Thanks for helping.

Best Regards

Joachim

--
Joachim Schreibmaier

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - numberformatexception - ". ,"

Jacopo Cappellato
Joachim,

which language/locale are you using for your OFBiz session?

Jacopo

Schreibmaier Joachim wrote:

> Hi,
>
> I have the following problem with the calculation of the invoices.
>
> The comma separator of my application should be the "," instead of "."
>
> In the general.properties file I the currency.decimal.format is ##.###,##
>
> When I try to lookup the invoices and process the payments I get the
> following error:
> Java.lang.NumberFormatException: For input string: "335,4".
>
> I have also the problem in the Inventory Receive method. But if I manually
> change the unit price from "50,00" to "50.00" it works.
>
> It doesn't bother us if we use a point or comma as value separator the main
> point the application runs without problems.
>
> Thanks for helping.
>
> Best Regards
>
> Joachim
>

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - numberformatexception - ". ,"

Schreibmaier Joachim
In reply to this post by Schreibmaier Joachim
> which language/locale are you using for your OFBiz session?

Here are my settings in my general.properties file:
# -- the default currency to use for prices, etc
currency.uom.id.default=EUR

# -- the default decimal format for currency
currency.decimal.format=##.###,##

# -- the default country for drop downs
country.geo.id.default=AUT

In my stores the Default Locale String is de_AT and the Default Currency Uom
Id is EUR.

What has to be done?

Thanks for helping.

Best Regards

Joachim

--
Joachim Schreibmaier

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - numberformatexception - ". ,"

Jacopo Cappellato
In reply to this post by Schreibmaier Joachim
Joachim,

what happens if you set back the currency.decimal.format parameter to
its original value?

currency.decimal.format=##0.00

Let me know!

Jacopo

Schreibmaier Joachim wrote:

>> which language/locale are you using for your OFBiz session?
>
> Here are my settings in my general.properties file:
> # -- the default currency to use for prices, etc
> currency.uom.id.default=EUR
>
> # -- the default decimal format for currency
> currency.decimal.format=##.###,##
>
> # -- the default country for drop downs
> country.geo.id.default=AUT
>
> In my stores the Default Locale String is de_AT and the Default Currency Uom
> Id is EUR.
>
> What has to be done?
>
> Thanks for helping.
>
> Best Regards
>
> Joachim
>

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - numberformatexception - ". ,"

Schreibmaier Joachim
In reply to this post by Schreibmaier Joachim
Jacopo,

> what happens if you set back the currency.decimal.format parameter to
> its original value?

> currency.decimal.format=##0.00

Same effect as before - NumberFormatException: For Input String "4,4"

Is it a bug?

Best Regards,

Joachim

--
Joachim Schreibmaier

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - numberformatexception - ". ,"

Jacopo Cappellato
In reply to this post by Schreibmaier Joachim
Joachim,

yes it could be a bug but I still cannot reproduce it... what version
are you running? Can you reproduce this error in an unmodified standard
OFBiz setup (with demo data)? If so, could you give me hints to
reproduce it?

Thanks,

Jacopo

Schreibmaier Joachim wrote:

> Jacopo,
>
>> what happens if you set back the currency.decimal.format parameter to
>> its original value?
>
>> currency.decimal.format=##0.00
>
> Same effect as before - NumberFormatException: For Input String "4,4"
>
> Is it a bug?
>
> Best Regards,
>
> Joachim
>

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - numberformatexception - ". ,"

Hans Bakker
In reply to this post by Schreibmaier Joachim
Dear Joachim,

currently i am localizing the accounting component and there are indeed some
problems when you switch from english to another european language with have
the dot and comma reversed in numbers and currencies.

please have some patience..it will be solved in a couple of days...

--
Regards,
Hans Bakker
ANT Websystems Co.,Ltd (http://www.antwebsystems.com)

If you want to verify that this message really originates from
from the above person, download the public key from:
http://www.antwebsystems.com/hbakkerAntwebsystems.asc

On Tuesday 18 April 2006 23:15, Schreibmaier Joachim wrote:

> > which language/locale are you using for your OFBiz session?
>
> Here are my settings in my general.properties file:
> # -- the default currency to use for prices, etc
> currency.uom.id.default=EUR
>
> # -- the default decimal format for currency
> currency.decimal.format=##.###,##
>
> # -- the default country for drop downs
> country.geo.id.default=AUT
>
> In my stores the Default Locale String is de_AT and the Default Currency
> Uom Id is EUR.
>
> What has to be done?
>
> Thanks for helping.
>
> Best Regards
>
> Joachim

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Users - numberformatexception - ". ,"

Schreibmaier Joachim
In reply to this post by Schreibmaier Joachim
Hans and Jacopo,

> currently i am localizing the accounting component and there are indeed
> some problems when you switch from english to another european language
> with have the dot and comma reversed in numbers and currencies.

I would be satisfied with the dot main thing it works.

> yes it could be a bug but I still cannot reproduce it... what version
> are you running? Can you reproduce this error in an unmodified standard
> OFBiz setup (with demo data)? If so, could you give me hints to
> reproduce it?

I am using ofbiz revision no. 6989. Of course I would like to upgrade. The
only thing I've changed was in the class ObjectType.java. Hans Bakker sent
me a patch with following content:
Index: base/src/base/org/ofbiz/base/util/ObjectType.java
===================================================================
--- base/src/base/org/ofbiz/base/util/ObjectType.java (revision 7197)
+++ base/src/base/org/ofbiz/base/util/ObjectType.java (working copy)
@@ -513,7 +513,7 @@
                     }
                     Number tempNum = nf.parse(str);
 
-                    return new Double(tempNum.doubleValue());
+                    return new Double(str);
                 } catch (ParseException e) {
                     throw new GeneralException("Could not convert " + str +
" to " + type + ": ", e);
                 }

I manually edited the file because I don't know how I can execute a patch
file. Can somebody tell me how I can handle it?

Best Regards
Joachim

--
Joachim Schreibmaier


 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - numberformatexception - ". ,"

David E. Jones
In reply to this post by Schreibmaier Joachim

The patch below is not the proper fix for this issue. That would be a step backward in locale awareness for this code. This change would ignore the locale passed into the method and would use the JVM's default locale, so it wouldn't work for any other locale. The intent with most of this is to process information according to the client's locale.

The proper fix would be higher up in making sure that the proper locale is passed in for the conversion from String to Double.

Again, we come back to the need for steps to reproduce it in the latest revision.

-David


Schreibmaier Joachim wrote:

> Hans and Jacopo,
>
>> currently i am localizing the accounting component and there are indeed
>> some problems when you switch from english to another european language
>> with have the dot and comma reversed in numbers and currencies.
>
> I would be satisfied with the dot main thing it works.
>
>> yes it could be a bug but I still cannot reproduce it... what version
>> are you running? Can you reproduce this error in an unmodified standard
>> OFBiz setup (with demo data)? If so, could you give me hints to
>> reproduce it?
>
> I am using ofbiz revision no. 6989. Of course I would like to upgrade. The
> only thing I've changed was in the class ObjectType.java. Hans Bakker sent
> me a patch with following content:
> Index: base/src/base/org/ofbiz/base/util/ObjectType.java
> ===================================================================
> --- base/src/base/org/ofbiz/base/util/ObjectType.java (revision 7197)
> +++ base/src/base/org/ofbiz/base/util/ObjectType.java (working copy)
> @@ -513,7 +513,7 @@
>                      }
>                      Number tempNum = nf.parse(str);
>  
> -                    return new Double(tempNum.doubleValue());
> +                    return new Double(str);
>                  } catch (ParseException e) {
>                      throw new GeneralException("Could not convert " + str +
> " to " + type + ": ", e);
>                  }
>
> I manually edited the file because I don't know how I can execute a patch
> file. Can somebody tell me how I can handle it?
>
> Best Regards
> Joachim
>
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - numberformatexception - ". ,"

Hans Bakker
In reply to this post by Schreibmaier Joachim
The patch is not the solution, it only suppresses the symptoms ...

however if you want to use my solution you have to upgrade because it is a
number of patches which will solve this....

Hans

On Thursday 20 April 2006 01:40, Schreibmaier Joachim wrote:

> Hans and Jacopo,
>
> > currently i am localizing the accounting component and there are indeed
> > some problems when you switch from english to another european language
> > with have the dot and comma reversed in numbers and currencies.
>
> I would be satisfied with the dot main thing it works.
>
> > yes it could be a bug but I still cannot reproduce it... what version
> > are you running? Can you reproduce this error in an unmodified standard
> > OFBiz setup (with demo data)? If so, could you give me hints to
> > reproduce it?
>
> I am using ofbiz revision no. 6989. Of course I would like to upgrade. The
> only thing I've changed was in the class ObjectType.java. Hans Bakker sent
> me a patch with following content:
> Index: base/src/base/org/ofbiz/base/util/ObjectType.java
> ===================================================================
> --- base/src/base/org/ofbiz/base/util/ObjectType.java (revision 7197)
> +++ base/src/base/org/ofbiz/base/util/ObjectType.java (working copy)
> @@ -513,7 +513,7 @@
>                      }
>                      Number tempNum = nf.parse(str);
>
> -                    return new Double(tempNum.doubleValue());
> +                    return new Double(str);
>                  } catch (ParseException e) {
>                      throw new GeneralException("Could not convert " + str
> + " to " + type + ": ", e);
>                  }
>
> I manually edited the file because I don't know how I can execute a patch
> file. Can somebody tell me how I can handle it?
>
> Best Regards
> Joachim
--
Regards,
Hans Bakker
ANT Websystems Co.,Ltd (http://www.antwebsystems.com)

If you want to verify that this message really originates from
from the above person, download the public key from:
http://www.antwebsystems.com/hbakkerAntwebsystems.asc

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Users - numberformatexception - ". ,"

Schreibmaier Joachim
In reply to this post by Schreibmaier Joachim
Hi,

I updated to revision no. 7349. I only updated the entityengine.xml and
general.properties file. When I open an invoice I have the problem that the
invoice amount is the hundredfold from the real amount which is correct in
the tab payments applied, payments open.



--
Joachim Schreibmaier
mailto:[hidden email]

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - numberformatexception - ". ,"

Hans Bakker
In reply to this post by Schreibmaier Joachim
As i mentioned before, this error is known and will be fixed in the next few
days.....


On Thursday 20 April 2006 18:37, Schreibmaier Joachim wrote:
> Hi,
>
> I updated to revision no. 7349. I only updated the entityengine.xml and
> general.properties file. When I open an invoice I have the problem that the
> invoice amount is the hundredfold from the real amount which is correct in
> the tab payments applied, payments open.

--
Regards,
Hans Bakker
ANT Websystems Co.,Ltd (http://www.antwebsystems.com)

If you want to verify that this message really originates from
from the above person, download the public key from:
http://www.antwebsystems.com/hbakkerAntwebsystems.asc

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users

attachment0 (196 bytes) Download Attachment