Formula engine: fix comparison trying to cast everything to decimal

Now it only tries to cast to decimal if both are numbers.
This commit is contained in:
Celtic Minstrel 2016-03-10 12:49:39 -05:00
parent b53ee994c9
commit e78b5d7baf

View File

@ -829,7 +829,10 @@ bool variant::operator!=(const variant& v) const
bool variant::operator<=(const variant& v) const
{
if(type_ != v.type_) {
if( type_ == TYPE_DECIMAL || v.type_ == TYPE_DECIMAL ) {
if(type_ == TYPE_DECIMAL && v.type_ == TYPE_INT) {
return as_decimal() <= v.as_decimal();
}
if(v.type_ == TYPE_DECIMAL && type_ == TYPE_INT) {
return as_decimal() <= v.as_decimal();
}