If you're adding a bunch of these up, it would be unneeded overhead.
Those building apps that handle financial data or other numerics that
require precision need the decimal data type.

On Dec 5 2008, 7:25 am, Justin <[email protected]> wrote:
> Why not store the value as a string in the datastore and convert it to
> adecimalin Python on retrieval? You could use a property on your
> model to do it for you.
>
> importdecimal
>
> class MyModel(db.Model):
>     string_amount = db.StringProperty(multiline=False)
>
>     def get_amount(self):
>           returndecimal.Decimal(self.string_amount)
>
>     def set_amount(self, value):
>           self.string_amount = str(value)
>
>     amount = property(get_amount, set_amount)
>
> - Justin
>
> On Dec 5, 3:11 am, "Fred Janon" <[email protected]> wrote:
>
> > Float andDecimalare two different types. Float is used in scientific
> > calculations,Decimalfor accounting/financial applications.Decimalexists
> > in Python but doesn't seem to be implemented in the Datastore.
>
> > Fred
>
> > On Fri, Dec 5, 2008 at 14:58, lock <[email protected]> wrote:
>
> > > There is the FloatProperty, pretty sure that's what your after.
>
> > >http://code.google.com/appengine/docs/datastore/typesandpropertyclass...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to