Improve test coverage

This commit is contained in:
Ben Ramsey
2020-02-26 20:17:49 -06:00
parent ba7c1c17ce
commit 0bd312f944
17 changed files with 540 additions and 5 deletions
+10
View File
@@ -51,6 +51,16 @@ final class Decimal implements NumberInterface
);
}
// Remove the leading +-symbol.
if (strpos($value, '+') === 0) {
$value = substr($value, 1);
}
// For cases like `-0` or `-0.0000`, convert the value to `0`.
if (abs((float) $value) === 0.0) {
$value = '0';
}
$this->value = $value;
}