On 05/14/2012 07:49 AM, Ed Leafe wrote:
> On May 14, 2012, at 9:36 AM, Adrian Klaver wrote:
>
>> Yes. Though I code my forms by hand. In other words I do not use
>> ClassDesigner.
>
>       That would make no difference.

Maybe so. All I know is I have not any problems over the years with the 
full precision being displayed in a grid using the code I showed:)

>
>> I do nothing special though:
>>
>>   priceCol = dabo.ui.dColumn(self, Name="stPrice", Caption="Price",
>>              DataField="st_trans_price", DataType="decimal.Decimal",
>>              Editable=True)
>>   self.addColumn(priceCol)
>>
>> This pulls from a Postgres database where the st_trans_price is a
>> numeric field with a scale of 5. This is reflected in the displayed values.
>
>       I think the problem is that you are setting the DataType to the string 
> "decimal.Decimal", instead of the actual type. Assuming that you have:

http://paul.dabodev.com/doc/api/dabodoc/dabo.ui.uiwx.dGrid.dColumn.html#Properties_DataType

DataType
Description of the data type for this column  (str)

The docs say it calls for a string and that is what I have been using 
with no ill effects, with the data type strings drawn from here:

http://wiki.dabodev.com/DataTypes



>
> from decimal import Decimal
>
> ...at the top of your script, try changing the column creation to:
>
>   priceCol = dabo.ui.dColumn(self, Name="stPrice", Caption="Price",
>              DataField="st_trans_price", DataType=Decimal,
>              Editable=True)
>   self.addColumn(priceCol)
>
>
>
> -- Ed Leafe
>
>
>
> _______________________________________________
> 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]


-- 
Adrian Klaver
[email protected]
_______________________________________________
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]

Reply via email to