Skip to content

Commit

Permalink
(decimal) explicit cast from PhpValue
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubmisek committed Sep 1, 2022
1 parent eb297d1 commit 5d22ff2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Peachpie.Runtime/PhpValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ public Convert.NumberInfo ToNumber(out PhpNumber number)

public static explicit operator double(PhpValue value) => value.ToDouble();

public static explicit operator decimal(PhpValue value) => value.ToDecimal();

public static explicit operator PhpNumber(PhpValue value)
{
if ((value.ToNumber(out var result) & Convert.NumberInfo.Unconvertible) != 0)
Expand Down

0 comments on commit 5d22ff2

Please sign in to comment.