Skip to content

Commit

Permalink
fix(client): Serialize all floats in exponential notation
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-johnson committed Oct 19, 2022
1 parent 5b93a1a commit 1176fcf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/client/src/runtime/query.ts
Expand Up @@ -651,6 +651,10 @@ function stringify(value: any, inputType?: DMMF.SchemaArgInputType) {
return value
}

if (typeof value === 'number' && inputType?.type === 'Float') {
return value.toExponential()
}

return JSON.stringify(value, null, 2)
}

Expand Down

0 comments on commit 1176fcf

Please sign in to comment.