studio
studio copied to clipboard
`Decimal` Precision Error
Bug description
Specific values are losing precision when typed into Decimal fields in Prisma Studio. Some example values: 83261.85
and 97.43
.
See also https://github.com/prisma/prisma/issues/20881
How to reproduce
Create a model with a decimal field, and enter a value of 83261.85
into a new record. Refresh, and see that 83261.85000000001
was persisted.
Expected behavior
Entering a value in prisma studio should persist that value, and not a different value.
Prisma information
Sample Schema:
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = "postgresql://local:local@localhost:5434/test_things?schema=public"
}
model ThingWithDecimal {
id Int @id @default(autoincrement())
amount Decimal
}
Environment & setup
- OS: MacOS
- Browser: Safari & Chrome
- Database: PostgreSQL
Prisma logs
No response