Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Shouldn't the scale options be between 0 and 6 (and not 0 and 2 as it currently is)? This way it is possible to store a latitude and longitude like -36.123456. I changed the options in the number module from 2 to 6 '#options' => drupal_map_assoc(range(0, 6)),
and it created the table fine.
Comment | File | Size | Author |
---|---|---|---|
#3 | number_precision.patch | 610 bytes | jmiccolis |
Comments
Comment #1
patrickharris CreditAttribution: patrickharris commentedBumpety bump.
Comment #2
dopry CreditAttribution: dopry commented?? what are you talking about and does it apply to 6.x-2.x.
Comment #3
jmiccolis CreditAttribution: jmiccolis commentedAttached is a patch that allows for a scale up to ten.
The issue here is that cck's number field will only allow very small scale options so that storing decimal numbers that require decent precision is impossible. The most common example for this is latitude and longitude. For example the current number module will only allow you to store decimals like 1.23, and not 1.23456789. This would be nice, and only requires a small form definition change in cck.
Comment #4
patrickharris CreditAttribution: patrickharris commentedNo action on this? I could just store latitude and longitude as text fields I guess if I wanted to keep them in cck.
Comment #5
El Bandito CreditAttribution: El Bandito commentedThis would be a useful feature for me too. Any chance ?
Cheers
Dave
Comment #6
jmiccolis CreditAttribution: jmiccolis commented@patrickharris & @daves - any chance either of you could review & test the patch and set the status to "patch (reviewed and tested by the community)"?
Thanks!
Comment #7
El Bandito CreditAttribution: El Bandito commentedjmiccolis
Would love to test, but I'm a newbie here and haven't got a clue how to go about it. If you could point me in the right direction I'd be happy to have a go.
Cheers
Dave
Comment #8
jmiccolis CreditAttribution: jmiccolis commented@Daves, Welcome!
First - download that patch, then apply -> http://drupal.org/patch/apply If you're a coder you'd probably want to look at what the patch files changes (which in this case isn't very much).
Next test it out, see if you're newly patched site has the functionality that the patch should add and that nothing else is broken.
Then post back - let us know if the patch worked, or not. If it did work and you're feeling confident change the status to 'patch (reviewed & tested by the community)' or if it's broken and you're feeling confident change the status to 'patch (code needs work)'
Comment #9
jmiccolis CreditAttribution: jmiccolis commentedAs this patch is one line (and as I talked to Karen about it) I'm changing the status to 'rtbc' (or the modern equivalent).
Cheers!
Comment #10
yched CreditAttribution: yched commentedCommitted #3 to 6.x-2.x. While mirroring the change to HEAD (D7), I noticed it used '6' as a max value for 'scale'. I bumped it to 10 for now.
Karen, do you know if there's a limitation ? Should we go for 6 instead of 10 ?
Comment #11
KarenS CreditAttribution: KarenS commentedWe should be consistent between D6 and D7. I think the use of '6' was just an arbitrary choice. I don't know of any reason not to use '10' in both places.
Comment #12
yched CreditAttribution: yched commentedOK then. Right now D6 and D7 are consistent.