CustomVariableNumber: add a hint for floats

This commit is contained in:
Thomas Gelf 2016-02-23 09:09:47 +01:00
parent 2d826ba939
commit 190b3efb98
1 changed files with 9 additions and 0 deletions

View File

@ -12,6 +12,15 @@ class CustomVariableNumber extends CustomVariable
return false;
}
// TODO: in case we encounter problems with floats we could
// consider something as follows, but taking more care
// about precision:
/*
if (is_float($this->value)) {
return sprintf($var->getValue(), '%.9F')
=== sprintf($this->getValue(), '%.9F');
}
*/
return $var->getValue() === $this->getValue();
}