@@ -56,13 +56,15 @@ class Decimal implements JsonSerializable, Stringable
5656 protected bool $ negative = false ;
5757
5858 /**
59+ * Decimal places to be applied to results
60+ *
5961 * decimal(10,6) => 6
6062 */
6163 protected int $ scale = 0 ;
6264
6365 /**
6466 * @param object|string|float|int $value
65- * @param int|null $scale Leave empty to auto-detect .
67+ * @param int|null $scale Decimal places in the result. Omit to enable auto-detection .
6668 */
6769 public function __construct (object |string |float |int $ value , ?int $ scale = null )
6870 {
@@ -143,7 +145,7 @@ protected function normalizeValue(string $value): string
143145 * it.
144146 *
145147 * @param object|string|float|int $value
146- * @param int|null $scale Leave empty to auto-detect .
148+ * @param int|null $scale Decimal places in the result. Omit to enable auto-detection .
147149 *
148150 * @return static
149151 */
@@ -247,7 +249,7 @@ public function compareTo(self|string|float|int $value): int
247249 * Add $value to this Decimal and return the sum as a new Decimal.
248250 *
249251 * @param static|string|float|int $value
250- * @param int|null $scale Leave empty to auto-detect .
252+ * @param int|null $scale Decimal places in the result. Omit to enable auto-detection .
251253 *
252254 * @return static
253255 */
@@ -281,7 +283,7 @@ protected function resultScale(self $a, self $b, ?int $scale = null): int
281283 * Decimal.
282284 *
283285 * @param static|string|float|int $value
284- * @param int|null $scale Leave empty to auto-detect .
286+ * @param int|null $scale Decimal places in the result. Omit to enable auto-detection .
285287 *
286288 * @return static
287289 */
@@ -389,7 +391,7 @@ public function isPositive(): bool
389391 * Multiply this Decimal by $value and return the product as a new Decimal.
390392 *
391393 * @param static|string|float|int $value
392- * @param int|null $scale Leave empty to auto-detect .
394+ * @param int|null $scale Decimal places in the result. Omit to enable auto-detection .
393395 *
394396 * @return static
395397 */
@@ -407,7 +409,7 @@ public function multiply(self|string|int|float $value, ?int $scale = null): stat
407409 * Divide this Decimal by $value and return the quotient as a new Decimal.
408410 *
409411 * @param static|string|float|int $value
410- * @param int $scale
412+ * @param int $scale Decimal places in the result
411413 *
412414 * @throws \DivisionByZeroError if $value is zero.
413415 *
@@ -427,7 +429,7 @@ public function divide(self|string|int|float $value, int $scale): static
427429 * This method is equivalent to the ** operator.
428430 *
429431 * @param static|string|int $exponent
430- * @param int|null $scale Leave empty to use current .
432+ * @param int|null $scale Decimal places in the result. Omit to enable auto-detection .
431433 *
432434 * @return static
433435 */
@@ -443,7 +445,7 @@ public function pow(self|string|int $exponent, ?int $scale = null): static
443445 /**
444446 * Returns the square root of this decimal, with the same scale as this decimal.
445447 *
446- * @param int|null $scale Leave empty to use current .
448+ * @param int|null $scale Decimal places in the result. Omit to enable auto-detection .
447449 *
448450 * @return static
449451 */
@@ -460,7 +462,7 @@ public function sqrt(?int $scale = null): static
460462 * This method is equivalent to the % operator.
461463 *
462464 * @param static|string|int $value
463- * @param int|null $scale Leave empty to use current .
465+ * @param int|null $scale Decimal places in the result. Omit to enable auto-detection .
464466 *
465467 * @return static
466468 */
@@ -474,7 +476,7 @@ public function mod(self|string|int $value, ?int $scale = null): static
474476 }
475477
476478 /**
477- * @param int $scale
479+ * @param int $scale Decimal places in the result (only used with mode "half up")
478480 * @param int $roundMode
479481 *
480482 * @return static
@@ -524,7 +526,7 @@ public function ceil(): static
524526 /**
525527 * The result of discarding all digits behind the defined scale.
526528 *
527- * @param int $scale
529+ * @param int $scale Decimal places in the result
528530 *
529531 * @throws \InvalidArgumentException
530532 *
0 commit comments