hi guys, just want to have quick confirmation a b...
# orm-help
d
hi guys, just want to have quick confirmation a bit confused with
db.decimal
. if I set it as
db.decimal(9,4)
, should it be like this
<tel:1234567891234|123456789.1234>
or
12345.1234
?
j
for postgres
Copy code
The precision of a numeric is the total count of significant digits in the whole number, that is, the number of digits to both sides of the decimal point. The scale of a numeric is the count of decimal digits in the fractional part, to the right of the decimal point. So the number 23.5141 has a precision of 6 and a scale of 4. Integers can be considered to have a scale of zero.
https://www.postgresql.org/docs/10/datatype-numeric.html
For Standard SQL it's the same
Copy code
Standard SQL requires that DECIMAL(5,2) be able to store any value with five digits and two decimals, so values that can be stored in the salary column range from -999.99 to 999.99.
d
hi @Jared Fraser, thanks for confirming, I know about defualt convention in mysql, just we got some error regarding this, but checkign on prisma documentation is make me not sure. We are just wondering if our problem related to how we write the schema.prisma. But after your confirmation, we are sure the problem persist from our code. Once again, thanks ! have a nice day 😄
👍 1