By theabacus on
Is there an existing module or technique to make CCK number field with a range? For example, it would handle 4-5 or 4,5-9? The module/technique would also need to be support by views, so if someone searches for "7" all nodes with that number would be retrieved (i.e. 7, 6-7, 4-9, etc).
I know it can be done by having two CCK number fields (min, max) and then using views filters, but this seem quite cumbersome. It would be much like the date field and api...just for numbers.
Comments
I need the same function
paining................cant make this done!!!!!
I would indeed use two number
I would indeed use two number fields and place them in one line with an '-' between them. I don't know of a module that gives you such a field. But what would be the difference if it was only one field?
You could also use one text field to input the number range and two computed fields to split the string (e.g. '4-6') into two values. I don't know how to check if the value in the text field is correctly formatted though. An own module would be better I think.