I have a function to check if an attribute value is smaller then another one:
public function getFnGminGrFnotKlFnut() {
if ($this->FnGmin) {
return $this->FnGmin > $this->fnot || $this->FnGmin < $this->fnut ? ['class' => 'danger'] : [];
} else {
return [];
}
}
View:
[
'attribute' => 'FnGmin',
'contentOptions' => function ($model) {return $model->fnGminGrFnotKlFnut;},
],
$this->FnGmin < $this->fnut
evaluates to true however if I'm printing the values they are equals. E.g. FnGmin = 8.37
and fnut = 8.37
and it's red! However sometimes the function returns correct evaluation! By FnGmin = 8.38
and fnut = 8.38
it's not red! There are no more hidden decimal places and roundings. What is going on? Can you please help me? I would greatly appreciate that!