Problem with floating point field totals.

Discuss HanDBase running on S60 devices by Nokia, Samsung and others.

Problem with floating point field totals.

Postby Luciano » Mon Apr 09, 2012 1:26 pm

This may have already been reported, but could not find it when I run a search.

I have defined a very simple database, and noticed a quirky problem in the running totals of a floating point field. The floating point field is set up as an amount, with two decimals. The total field has been set up the traditional way Pn+Fn (the previous value of the total field + the value of the amount in the floating point field).

The problem: After changing the view, the floating point field adds as 1 or 2 (not the value int he field). Before the total field, I had a memo or note field. I thought that might interfere, so I reset the note field to be a text field instead, and the adding problem seems to be gone.
Luciano
 
Posts: 3
Joined: Mon Apr 09, 2012 1:15 pm

Re: Problem with floating point field totals.

Postby Luciano » Wed Apr 11, 2012 7:42 pm

I am afraid I was wrong.
Whenever using the floating field for amounts over 1,000 the problem is consistent. Here is how to reproduce it:
- Define a floating point field, and then a calculated field to keep the running total as usual.
- Access the database from the S60 phone and enter in the floating field an amount greater than 1,000.
- The calculated field will only recognize the first digit (1 for 1,000 or 2 for 2,000 etc.) and treat it as the entire amount.

Note: in the desktop version of the database this doe not happen, as the amount entered does not include a comma "," after the thousand figure (i.e.: 1200.00), while in the S60 database, a comma is added (i.e.: 1,200.00). I think this may be what is "fooling" the calculated field, as it may be reading that comma as the decimal separator. Weird, though.

Any solutions, please?
Thanks in advance.
Luciano
 
Posts: 3
Joined: Mon Apr 09, 2012 1:15 pm

Re: Problem with floating point field totals.

Postby dhaupert » Thu Apr 12, 2012 7:49 am

Hi there,

The comma and the decimal point both act as separators in a floating point field. In some countries the comma is the floating point separator so this is the reason behind it! Does your device automatically add the comma or are you typing that in? If it's you, the solution is easy- just don't type a comma in a float field! If it's being auto entered, that's something I haven't experienced before. Let me know if that's the case!
dhaupert
 
Posts: 4055
Joined: Tue May 26, 2009 11:51 am

Re: Problem with floating point field totals.

Postby Luciano » Sat Apr 14, 2012 12:19 am

Thank you for your answer.

In some countries the comma is the floating point separator so this is the reason behind it!

Yes, I am aware of that, and did not think much of it until I found the problem indicated.

If it's you, the solution is easy- just don't type a comma in a float field!

:o

Does your device automatically add the comma or are you typing that in? [...] If it's being auto entered, that's something I haven't experienced before. Let me know if that's the case!

Yes, in the desktop application it is not added, and everything works fine.
In the S60 application (I am using a Nokia E5), instead the comma is added automatically, and there is no way of eliminating it. By the way, when you enter a number of records with an amount less than 1,000 and it all adds up to more than 1,000 it works fine. The problem is consistent when you enter a number greater than 999 in a float field.

I hope this helps.
Luciano
 
Posts: 3
Joined: Mon Apr 09, 2012 1:15 pm


Return to HanDBase for S60

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron