17691 Posts in 4607 Topics by 2180 members
General Questions
SilverStripe Forums » General Questions » NumericField() and negative numbers
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 932 Views |
-
NumericField() and negative numbers

9 September 2009 at 11:52pm
NumericField() does not support negative numbers. If I supply "-100" it returns:
'-555' is not a number, only numbers can be accepted for this field
Is this a bug or am I missing something?
-
Re: NumericField() and negative numbers

20 February 2010 at 1:13pm Last edited: 20 February 2010 1:19pm
I get the same error in my custom CMS tab when I try to enter a negative number into the Int field.
For example,
With this
public static $db = array(
'TopMargin' => 'Int',
);and this
...
new NumericField("TopMargin", "Top Margin"),
...I get "'-20' is not a number, only numbers can be accepted for this field".
As a result, I am having to use TextField instead.Perhaps I am missing somethings as well? Negative integers are numbers.
Anyone have any ideas?
Thanks,
Sam -
Re: NumericField() and negative numbers

24 February 2010 at 7:52pm
Looks like a bug. I've opened a ticket and posted a patch here: http://open.silverstripe.org/ticket/5116
| 932 Views | ||
|
Page:
1
|
Go to Top |



