mirror of
https://github.com/danog/math.git
synced 2025-01-22 21:51:22 +01:00
Simplify BigDecimal::ofUnscaledValue()
This commit is contained in:
parent
9017519b5d
commit
147df4b73c
@ -78,15 +78,7 @@ final class BigDecimal extends BigNumber implements \Serializable
|
||||
throw new \InvalidArgumentException('The scale cannot be negative.');
|
||||
}
|
||||
|
||||
if (is_int($value)) {
|
||||
return new BigDecimal((string) $value, $scale);
|
||||
}
|
||||
|
||||
if (! $value instanceof BigInteger) {
|
||||
$value = BigInteger::of($value);
|
||||
}
|
||||
|
||||
return new BigDecimal((string) $value, $scale);
|
||||
return new BigDecimal((string) BigInteger::of($value), $scale);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user