Has anyone else had problems with `@db.Decimal(XX,...
# orm-help
j
Has anyone else had problems with
@db.Decimal(XX, 5)
? For some reason when I set my data to 5 decimal places, the values come out like
12.000000000000002
. Not only is it adding a float rounding error, they have too many decimal places. Setting it to 2,3,4,and 6 work fine. I haven’t checked above that point.
j
What database connector are you using? And have you checked the resulting table structure via a database client like TablePlus or the like yet? I'd be interested to see what it casts it as.
j
Good thought. I’ll check. This is mySQL.
Oh yeah… That is the native type.
Or more specifically,
DECIMAL
with a length of
20,5
n
Hey Jason 👋 Are you still facing this issue?
j
Yeah.
n
What’s your prisma version? I would like to try to reproduce it
j
3.12.0. I checked 3.13, and didn’t see a reference to a fix for this.
I’m checking 3.13 now.
j
actually.. @Jason Kleinberg have you tried doing a raw query with prisma to see if the output is similar? it'd help determine if it is an issue with the connector or the orm layer tbh
might help with diagnostics 🤷
j
I do believe that that was in a raw query. I’m not positive. I will update if that isn’t the case.