Malclom,

Thanks for the helpful answer. I need to do numerical work on the
values so I think I'll store the currency type in a separate field.

Cheers,


On Nov 22, 10:54 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2008-11-21 at 17:49 -0800, dash86no wrote:
> > I'm have a number of "price" fields in my application. I searched
> > around the net and it seems to be the case that there are no explicit
> > currency types in Django. What is the best data type to use for
> > currency? Would it be decimal?
>
> It depends. A decimal field is certainly the right choice for the
> numerical value. You also want to consider whether you need to store the
> currency type, if it varies or might change for different rows in the
> table. An extra character field or integer field to store the type could
> then be used. Or you could use a character field and store a normalised
> representation of the type + value, if you only wanted one column and
> didn't need to directly do numerical work with the values (that is, you
> could store "JPY 14000", "AUD 27.34", etc).
>
> So consider if you want to work with the values numerically and if the
> current type is a variable as well.
>
> Regards,
> Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to