Initial commit
Build / run (push) Has been cancelled

This commit is contained in:
maher
2026-05-14 13:42:10 +02:00
commit 511fad8199
4595 changed files with 385164 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace Common\Database\Metrics\Traits;
trait RoundingPrecision
{
public int $roundingPrecision = 0;
public int $roundingMode = PHP_ROUND_HALF_UP;
/**
* Set the precision level used when rounding the value.
*/
public function precision(
int $precision = 0,
int $mode = PHP_ROUND_HALF_UP,
): static {
$this->roundingPrecision = $precision;
if (
in_array($mode, [
PHP_ROUND_HALF_UP,
PHP_ROUND_HALF_DOWN,
PHP_ROUND_HALF_EVEN,
PHP_ROUND_HALF_ODD,
])
) {
$this->roundingMode = $mode;
}
return $this;
}
}