Skip to content

Commit

Permalink
ecs-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Aug 2, 2022
1 parent 526ab9d commit 14c7e04
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Internal/Service/MathService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,38 @@ public function add(float|int|string $first, float|int|string $second, ?int $sca
return (string) BigDecimal::of($first)
->plus(BigDecimal::of($second))
->toScale($scale ?? $this->scale, RoundingMode::DOWN)
;
;
}

public function sub(float|int|string $first, float|int|string $second, ?int $scale = null): string
{
return (string) BigDecimal::of($first)
->minus(BigDecimal::of($second))
->toScale($scale ?? $this->scale, RoundingMode::DOWN)
;
;
}

public function div(float|int|string $first, float|int|string $second, ?int $scale = null): string
{
return (string) BigDecimal::of($first)
->dividedBy(BigDecimal::of($second), $scale ?? $this->scale, RoundingMode::DOWN)
;
;
}

public function mul(float|int|string $first, float|int|string $second, ?int $scale = null): string
{
return (string) BigDecimal::of($first)
->multipliedBy(BigDecimal::of($second))
->toScale($scale ?? $this->scale, RoundingMode::DOWN)
;
;
}

public function pow(float|int|string $first, float|int|string $second, ?int $scale = null): string
{
return (string) BigDecimal::of($first)
->power((int) $second)
->toScale($scale ?? $this->scale, RoundingMode::DOWN)
;
;
}

public function powTen(float|int|string $number): string
Expand All @@ -65,21 +65,21 @@ public function ceil(float|int|string $number): string
{
return (string) BigDecimal::of($number)
->dividedBy(BigDecimal::one(), 0, RoundingMode::CEILING)
;
;
}

public function floor(float|int|string $number): string
{
return (string) BigDecimal::of($number)
->dividedBy(BigDecimal::one(), 0, RoundingMode::FLOOR)
;
;
}

public function round(float|int|string $number, int $precision = 0): string
{
return (string) BigDecimal::of($number)
->dividedBy(BigDecimal::one(), $precision, RoundingMode::HALF_UP)
;
;
}

public function abs(float|int|string $number): string
Expand Down

0 comments on commit 14c7e04

Please sign in to comment.