Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
field system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Nov 2009 at 17:01 UTC
Updated:
26 Nov 2009 at 21:10 UTC
number_field_widget_validate() currently does:
// Let PHP round the value to ensure consistent behavior across storage
// backends.
if ($type == 'decimal') {
$value = round($value, $field['settings']['scale']);
}
This has to be done at field level, in hook_field_presave(), so that this applies to programmatic saves as well.
| Comment | File | Size | Author |
|---|---|---|---|
| field_number_round.patch | 2.46 KB | yched |
Comments
Comment #1
sunPlease note that all new code should use Implements. But since we have to run a global s/Implement/Implements/ anyway, no reason to hold off this patch.
This review is powered by Dreditor.
Comment #2
dries commentedI fixed the implements and committed this patch to CVS HEAD. Thanks!