diff options
| author | Sebastien Castiel <sebastien@castiel.me> | 2023-12-12 09:20:05 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-12 09:20:05 -0500 |
| commit | 1ed533d01f2b555c9999a38ebb9d4dba7de868c6 (patch) | |
| tree | 3792c5ca6e08b64a4d812e2e957d1fc4d6e821c6 /src | |
| parent | 4f43e8e42a17861855226757d3e825e3ff761018 (diff) | |
Fix string to number conversion in expense schema (Fix #1) (#2)
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/schemas.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts index ec7f3fa..9c79355 100644 --- a/src/lib/schemas.ts +++ b/src/lib/schemas.ts @@ -53,7 +53,7 @@ export const expenseFormSchema = z.object({ code: z.ZodIssueCode.custom, message: 'Invalid number.', }) - return Math.floor(valueAsNumber * 100) + return Math.round(valueAsNumber * 100) }), ], { required_error: 'You must enter an amount.' }, |
