{"id":"data2-csv-currency-text-to-numbers","audience":"finance","category":"data","track":"data","technique":"examples","level":"beginner","title":"Convert messy money text into clean numbers in a CSV block","free":false,"task":"An expense export has money typed many ways. Write one CSV block (one code block) with the header original,amount and one row per value, in the same order, where amount is a plain number with two decimals and no symbols or commas. Brackets mean negative, and n/a becomes an empty amount. At most 12 words outside the code.","materialLabel":"Messy amounts (attached to your prompt automatically)","material":"Expense export - column \"Amount\" (Alderwood Consulting), 8 values:\n\n1. $1,250.00\n2. (300.00)\n3. 2,400\n4. USD 90\n5. n/a\n6. 1 100.50\n7. -45.5\n8. $0.99\n\nContext:\n- All values are US dollars.\n- Brackets mean a refund, so (300.00) is minus 300.00.\n- The \"1 100.50\" value uses a space as a thousands separator.\n- Finance will paste the amount column into the ledger tool, which rejects symbols and commas.\n- The export comes from three employees' expense apps, each of which formats money differently.\n- There are about 900 rows in the full file; this is just a sample of 8 for the cleanup rules.\n- Row order must stay the same so the amounts can be pasted back next to the original rows.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":12}],"mistakes":[{"title":"Losing the minus sign","why":"The AI reads (300.00) as positive 300.00.","fix":"Add: \"Brackets mean negative: (300.00) -> -300.00.\"","checks":["r0"]},{"title":"Putting 0 for n/a","why":"The AI writes 0 or N/A, which the ledger would treat as real.","fix":"Add: \"n/a -> leave amount empty.\"","checks":["r1"]},{"title":"Keeping symbols and commas","why":"$1,250.00 stays as typed or loses its decimals.","fix":"Add: \"Two decimals, no $, no commas, in the same order.\"","checks":["r2"]},{"title":"Leaving the format to chance","why":"The AI picks its own length and layout unless told the exact shape.","fix":"Add: \"Put the code in exactly 1 code block. Keep the writing outside the code under 12 words.\"","checks":["codeBlocks","maxProseWords"]}],"promptHints":[{"label":"Mentions brackets","patterns":["bracket","\\(300"]},{"label":"Handles n/a","patterns":["n/a","empty"]},{"label":"Asks for the header","patterns":["original,amount","header"]},{"label":"Gives the number format","patterns":["two decimals","no \\$","no commas"]},{"label":"Keeps the order","patterns":["same order","8 rows"]}],"hint":"Cleanup rules go in the prompt with two examples; the AI shouldn't guess what brackets or n/a mean.","mission":"Convert these amounts to numbers.","musts":["One CSV block","Brackets are negative","n/a becomes empty"],"rubricLabels":["Values 1 to 4 become 1250.00, -300.00, 2400.00 and 90.00","Values 5 to 8 become an empty amount for n/a, 1100.50, -45.50 and 0.99","The code block is CSV with the header original,amount and 8 rows in the original order, with no $ signs, commas or brackets in the amount column"]}