postgres icon indicating copy to clipboard operation
postgres copied to clipboard

Parse float8 to number

Open remiposo opened this issue 7 months ago • 0 comments

Is your feature request related to a problem? Please describe.

Currently, float4 is being parsed as number, but float8 is returned as string. https://github.com/denodrivers/postgres/blob/main/query/decode.ts#L72

Based on node-pg-types, it seems that parsing float8 with parseFloat, just like float4, should be fine. https://github.com/brianc/node-pg-types/blob/master/lib/textParsers.js#L144

Is this difference intentional? If there’s no specific reason for the difference, I think it would be clearer to align the behavior of the two.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

remiposo avatar Apr 24 '25 04:04 remiposo