Skip to content

Commit

Permalink
Fix money column results with ext-pgsql
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Dec 18, 2022
1 parent f52cc35 commit c3d2490
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/PgSqlResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ private function cast(int $oid, string $value)
switch ($oid) {
case 700: // float4
case 701: // float8
case 790: // money
case 1700: // numeric
return (float) $value;

case 790:
return $value; // money includes currency symbol as string.

default: // Cast all other numeric types to an integer.
return (int) $value;
}
Expand Down

0 comments on commit c3d2490

Please sign in to comment.