[Solved, basically] java.lang.NumberFormatException

Discuss the database features
Post Reply
GJM
Posts: 56
Joined: Thu Feb 21, 2008 6:19 pm

[Solved, basically] java.lang.NumberFormatException

Post by GJM »

I have created a Data base and one of the fields that I have can be filled using a combo box (you choose a present entry so save time when entering data).

Everything was fine until i updated to OO 3.2.0

now when i select my number from the drop down box I get this error:

java.lang.NumberFormatException

when I select the more info it says this:

Error code: -1
java.lang.NumberFormatException

Here is a closer look:
dropdown1.jpg
dropdown2.jpg
dropdown3.jpg
Last edited by GJM on Sun Apr 25, 2010 10:36 am, edited 1 time in total.
GJM
Posts: 56
Joined: Thu Feb 21, 2008 6:19 pm

Re: java.lang.NumberFormatException

Post by GJM »

dropdown4.jpg
This is the last image.

Do I have to revert Back to OO 3.1. to get this to work? what am i missing?
eremmel
Posts: 1080
Joined: Tue Dec 30, 2008 1:15 am

Re: java.lang.NumberFormatException

Post by eremmel »

Did you try to edit the document and change the field format to an other value (there might be something going wrong with reading your document in OOo 3.2)
Can you post a copy of your document (remove important information).
It's Microsoft marketing that tells you computers are qualified for non-technicians
W11 22H2 (build 22621), LO 7.4.2.3(x64)
GJM
Posts: 56
Joined: Thu Feb 21, 2008 6:19 pm

Re: java.lang.NumberFormatException

Post by GJM »

It definitely seems to be something with OO 3.2.0 as I took the file to a machine that I haven't upgraded yet (still running 3.1) and it works just fine.

I'll have to see if can post a copy of the file in a couple of days (can't do it right now).

I am wondering if it has something to do with fact that there is a '$' symbol in the choice (the drop down menu). The entry field type was set to 'Number [numeric]' and I noticed that the Format Example Category was set to just "Number"
1format.gif
When I changed it to Currency that didn't seem to help at all.
2format.gif
I noticed that the entries created with oo 3.1.1 where showing this:
3format.gif
GJM
Posts: 56
Joined: Thu Feb 21, 2008 6:19 pm

Re: java.lang.NumberFormatException

Post by GJM »

I formatted the fields to be a 'currency' (as it probably should have been from the beginning).

The problem seemed to originate with the fact that the Default entries that I had created had a '$' symbol in it.
As soon as I removed those symbols from the default entries, it seemed to work normal again.
4format.gif
Thanks eremmel for the help. If you'd still like a copy of the file (in the form it was originally giving me trouble) I can do that for you if you like a little later.
Again, thanks for the help.
GJM
Posts: 56
Joined: Thu Feb 21, 2008 6:19 pm

Re: java.lang.NumberFormatException

Post by GJM »

This doesn't trouble me much, but if there is a 'right' way to do this I'd like to try to do it that way even though it is 'functional' the way it is. Here is what I have now that it is basically working:
5format.gif
The amount in the drop down shows 4.6 after saving ...
while the amount in the actual column field it was saving to displays properly with the 2 decimal places and the '$' symbol ( I know it is not necessary - it is what it is)

I am not sure what to make of this.

The one thing that I don't understand is why when the field is NOT formatted with "currency" (and the associated '$' symbol), it displays the '$' anyway, and the refund box after saving shows 4.60 rather than 4.6 - not sure what I am missing here.

Anyone?
GJM
Posts: 56
Joined: Thu Feb 21, 2008 6:19 pm

Re: java.lang.NumberFormatException

Post by GJM »

I am trying to attach a file so that someone can take a peak at it.

I have deleted all the rows in all the tables that have data on it yet the file is STILL 1,271 Kb/s in size and I can't upload it here.

Again, I've deleted all the data.

All you see is that the new first entry starts on row 1195.

What am I missing?

Thanks
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: java.lang.NumberFormatException

Post by Villeroy »

Tools>Sql... shutdown compact
Close the document.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
GJM
Posts: 56
Joined: Thu Feb 21, 2008 6:19 pm

Re: java.lang.NumberFormatException

Post by GJM »

Thanks Velleroy! That worked.

I have attached the file so that others can take a peak at what I am seeing

A quick recap of my query:

1. Why the error when selecting a default that has the '$' symbol in it.
2. Why when I remove the '$' sign and choose that entry (that doesn't have the '$' symbol) that the '$' symbol goes into the field anyway -- whether it is formatted as 'currency' or not.

Note, that I have the "Income Table's" Amount column formatted with 'currency', and;
the Refund column formatted with 'Number';
... both drop downs have default entries with and without the '$' symbol in them.
This was done for testing purposes so that you can see what I am seeing.

Again, thanks for the help folks!
Attachments
2010-forum-sample.odb
(19.87 KiB) Downloaded 252 times
eremmel
Posts: 1080
Joined: Tue Dec 30, 2008 1:15 am

Re: java.lang.NumberFormatException

Post by eremmel »

I think that the fact that OOo 3.2 complains about the leading '$' is a bug. I do not see it back in the development version 3.3.0m75.

The formatting specification of a field in the table design is pure for the presentation of the data in that field. You will see that when you just open the table to view/edit the data in the table. When you use a Combo-Box you have a general format that take some, but not all properties from that specification (it misses a format-property). At least it does not like a currency specification. In your grid, you use a currency-formatted column, so that overrules the specification from the table definition.

So for the time being remove the '$' from your list in the combo-box and make the table format specification of amount equal to the specification of the field refund. That restores at least the two digits after the dot.
It's Microsoft marketing that tells you computers are qualified for non-technicians
W11 22H2 (build 22621), LO 7.4.2.3(x64)
GJM
Posts: 56
Joined: Thu Feb 21, 2008 6:19 pm

Re: java.lang.NumberFormatException

Post by GJM »

Thanks for looking at this folks.

I'll take it as it is a bug for now, unless anyone else has a comment.

Cheers
Post Reply