On 11/17/10 11:56 AM, Iain Simpson wrote:
> I'm recording the longitude& latitude of the place the photo was made.
> These are stored as real (floating point) values of with up to 5 or 6
> significant decimal places.
> On Dabo these are displayed (using a spinner) with only 2 decimal places
> visible.
So you need to see 5 or 6 decimal places, but only 2 are showing in the
spinner. To
eliminate the possibility that this is a problem with dSpinner, try temporarily
changing those to dTextBox controls instead, which can handle numeric values
just fine.
If you still see 2 decimal places, my money's on needing to set the
biz.DataStructure
explicitly because there's no way for Dabo to get the decimal precision from
SQLite
because of the nature of SQLite.
While running your app, open up a command window with Ctrl+D, and issue:
>>> biz = self.getBizobj()
>>> print biz.Record.latitude (or whatever your field name is)
Did it show 2 decimal places or the correct 5 or 6? If it showed the correct
precision, there is an unexpected problem in the UI layer. If it showed 2, read
on.
Let's fix the DataStructure of the bizobj, and see if that makes a difference.
In the
command window, issue:
>>> print biz.DataStructure
Copy the output to the clipboard, and then open up your script that contains
your
bizobj definition, and paste the DataStructure into the initProperties()
method.
You'll need to end up with something like this, copied/pasted from some of my
code:
class MyBizobj(dabo.biz.dBizobj):
def initProperties(self):
self.DataStructure = (
("id", "C", True, "mytable", "id"),
("name", "C", False, "mytable", "name"),
("latitude", "N", False, "mytable", "latitude", 6),
)
DataStructure is computed automatically by Dabo unless you specify it
explicitly.
Especially when working with SQLite, I recommend setting DataStructure
explicitly.
Each element in the outer sequence is a sequence specifying:
0) field alias name (the alias given in the SQL select statement)
1) field type (in dabo single-letter notation)
2) bool indicating if the field is the primary key
3) table name on the backend
4) field name on the backend
5) decimal precision of numeric field (defaults to 2)
Once the DataStructure looks right, run your app again and see if it made a
difference. I bet it does!
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]