Skip to content

Commit d75bdec

Browse files
authored
Update DecimalObjectCast.php
1 parent ca6ecbd commit d75bdec

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/DecimalObjectCast.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,10 @@ public function setAttribute($key, $value)
6161
if ($this->isDecimalCast($castType)) {
6262
if (!$value instanceof Decimal) {
6363
$value = $this->castAttribute($key, $value);
64-
assert($value instanceof Decimal);
6564
}
6665

67-
$decimals = explode(':', $castType)[1];
68-
$this->attributes[$key] = $value->toFixed((int)$decimals, false, PHP_ROUND_HALF_UP);
66+
$decimals = explode(':', $castType)[1];
67+
$this->attributes[$key] = $value->toFixed($decimals, false, PHP_ROUND_HALF_UP);
6968

7069
return $this;
7170
}

0 commit comments

Comments
 (0)