Skip to content

Commit 958208a

Browse files
committed
fix: Invalid input syntax for type integer (vercel#636)
1 parent 0e41ddc commit 958208a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dashboard/final-example/app/lib/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export async function createInvoice(prevState: State, formData: FormData) {
5151

5252
// Prepare data for insertion into the database
5353
const { customerId, amount, status } = validatedFields.data;
54-
const amountInCents = amount * 100;
54+
const amountInCents = Math.round(amount * 100);
5555
const date = new Date().toISOString().split('T')[0];
5656

5757
// Insert data into the database
@@ -91,7 +91,7 @@ export async function updateInvoice(
9191
}
9292

9393
const { customerId, amount, status } = validatedFields.data;
94-
const amountInCents = amount * 100;
94+
const amountInCents = Math.round(amount * 100);
9595

9696
try {
9797
await sql`

0 commit comments

Comments
 (0)