toFloat(); return $this->isPositive() ? "{$this->currency} {$amount}" : "-{$this->currency} {-$amount}"; } public function toFloat() : float { return round($this->amount /100, 2); } public function formatted() : string { $amount = $this->toFloat(); return $this->isPositive() ? "\${$amount}" : "-\${-$amount}"; } public function isPositive() : bool { return $this->amount >= 0; } public function isNegative() : bool { return $this->amount < 0; } public function isZero() : bool { return $this->amount === 0; } public function greaterThan(Money $other) : bool { return $this->amount > $other->amount; } public function greaterThanOrEqual(Money $other) : bool { return $this->amount >= $other->amount; } public function lessThan(Money $other) : bool { return $this->amount < $other->amount; } public function lessThanOrEqual(Money $other) : bool { return $this->amount <= $other->amount; } }