Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.6-1
Component:
number.module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2008 at 04:25 UTC
Updated:
12 Jul 2009 at 15:00 UTC
Hi there,
I need to store a price (with two decimals) in the number field, but for bigger numbers. However, the float field created by number.module in the dbase handles this well for smaller amounts, but bigger amounts are rounded. I read this post http://drupal.org/node/109246 and tried to apply the patch(es) but it gave me some errors.
My question: is changing the data type field in the database from float to decimal(10,2) bad? It seems to work (for now) but I thought I'll ask the exerts how they think about it. If I am correct this issue will be solved in drupal 6, but I just build my site in drupal 5.
Thank you for any response or advice.
Greetings!
Comments
Comment #1
karens commentedThis is a limitation of the float field used in D5. See #501016: Big numbers (>10,000) get rounded up and other reports. This won't get fixed in D5. D6 has a proper decimal field. You will want to test your results when trying to convert, unfortunately we can't provide any support for D5 any more. You may want to add a new decimal field to your content type and copy the data to that field, then test to be sure you got the right results before deleting the original float field.