function BigDecimal::getFractionalPart
Returns a string representing the fractional part of this decimal number.
If the scale is zero, an empty string is returned.
Examples: `-123.456` => '456', `123` => ''.
1 call to BigDecimal::getFractionalPart()
- BigDecimal::hasNonZeroFractionalPart in vendor/
brick/ math/ src/ BigDecimal.php - Returns whether this decimal number has a non-zero fractional part.
File
-
vendor/
brick/ math/ src/ BigDecimal.php, line 593
Class
- BigDecimal
- Immutable, arbitrary-precision signed decimal numbers.
Namespace
Brick\MathCode
public function getFractionalPart() : string {
if ($this->scale === 0) {
return '';
}
$value = $this->getUnscaledValueWithLeadingZeros();
return \substr($value, -$this->scale);
}