Skip to content

Commit

Permalink
handle both ints and floats
Browse files Browse the repository at this point in the history
  • Loading branch information
mlebkowski committed Dec 6, 2024
1 parent e908c2c commit 9837263
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Accessor/StringValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public function toInt(): int {
}

public function toFloat(): float {
if (is_int($this->raw)) {
return $this->raw;
if (is_float($this->raw) || is_int($this->raw)) {
return (float) $this->raw;
}

if (false === is_numeric($this->value)) {
Expand Down

0 comments on commit 9837263

Please sign in to comment.