Write the follow-up prompt for a strict price parser

Vibe codingEasy20 min

Your task

You asked an assistant for a JavaScript function, parsePrice(text), for the price field in your shop's admin. It works on the prices you tried, but QA found that it rejects 1,299.00. Sellers paste prices from spreadsheets and invoices, so the field has to accept thousands separators.

Write the follow-up prompt you would send.

What you know:

  • the assistant's regular expression only allows digits and one optional dot, such as 1299 or 1299.5
  • prices are in US dollars, and the function returns a whole number of cents, or null when the text is not a price
  • a wrong price costs the seller money, while a rejected one only asks them to type it again
  • you want a function that is easy to read, not one that handles every currency and locale

Then, in a few sentences: why is "that's wrong, fix it" a weak follow-up?