mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-15 16:07:55 +03:00
Improve test coverage
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user