Closed (duplicate)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.4
Component:
number.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Mar 2007 at 23:37 UTC
Updated:
19 Jul 2007 at 19:04 UTC
Using a number_decimal, if one enters a large value, it is converted to scientific notation.
For example, in a field I enter "1000000" and submit and when I view I see I have "1e+06". This is fine. However, if I edit that page and do not change that field it will be resaved as "106".
Essentially, the module converts TO scientific notation but not FROM, which results in drastically changing values when resaving a page unless one manually reenters the value each time one makes any change at all to the page.
Comments
Comment #1
yched commentedThis is a duplicate of http://drupal.org/node/115632 (but the way you present the bug makes it critical in fact)
On a related note, see http://drupal.org/node/109246 about additional numeric datatypes.
Comment #2
bchoc commentedSorry ... I did look for duplicates before posting, but 115632 somehow didn't equate to the same thing in my mind, so I guess I overlooked it.
Comment #3
yched commentedNo problem. As I wrote, your 'version' of the bug clearly showed its 'critical' level.
Comment #4
joshk commentedAdding the following to the numeric_field() function within the switch($op) block prevents the worst of this behavior:
The real issue is that columns of type float shouldn't be used to store decimal data, as even with this code, we only get six significant digits of precision.