-
Notifications
You must be signed in to change notification settings - Fork 2.2k
JSON value truncate floating numbers #3918
Copy link
Copy link
Closed
prisma/prisma-engines
#1342Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.kind/bugA reported bug.A reported bug.tech/enginesIssue for tech Engines.Issue for tech Engines.tech/typescriptIssue for tech TypeScript.Issue for tech TypeScript.topic: broken querytopic: floating point typesTopic related to floating point types and precision lossTopic related to floating point types and precision losstopic: sqlx
Milestone
Metadata
Metadata
Assignees
Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.kind/bugA reported bug.A reported bug.tech/enginesIssue for tech Engines.Issue for tech Engines.tech/typescriptIssue for tech TypeScript.Issue for tech TypeScript.topic: broken querytopic: floating point typesTopic related to floating point types and precision lossTopic related to floating point types and precision losstopic: sqlx
Bug description
When I store a JSON value with floating numbers, Prisma seems to truncate the number and this leads to loss of precision and incorrect values.
How to reproduce
The logged query is (which makes me think this comes from Prisma and not from the database):
Notice the ending of the
rnumber, it's truncated. But not for theborgvalue.Expected behavior
The stored value for
rshould be0.92156863212585449and not0.9215686321258544.Prisma information
Environment & setup
Related
This could be related
#3479
#2903