# Verify Decimal Rounding in a Synthetic CSV Amount Import

https://ferkesh.net/zh/knowledgebase/article/csv-import-decimal-amount-rounding-fixture

A CSV amount arrives as text. Converting it to a binary floating-point value too early can introduce a representation difference that surfaces later in totals or round trips.

![Workflow. Define decimal scale. Trace parsed values. Compare exact totals. Verify invalid input.](https://ferkesh.net/kb-media/ferkesh-guide-diagrams-batch-17c.svg#csv-import-decimal-amount-rounding-fixture)

## Define allowed input and rounding

Document separators, allowed sign, currency scale and the approved rounding policy. Create synthetic boundary cases, including a value with more fractional digits than the destination accepts. Record exact expected output per row.

## Trace the value through the import

Check how the parser treats the field and how the application validates it. Use fixed-point decimal facilities or a documented scaled integer representation where exact monetary units are required. Check the actual database column precision and scale.

## Test values and totals separately

Compare raw accepted values, stored values and export output. Sum the same fixture using the documented precision and rounding stages. A correct visible value does not establish that totals remained correct.

## Verify rejection and recovery

Test one intentionally invalid value and confirm the import follows the expected policy. Record the format and expected totals for future releases.

## Related guides

- [Convert CSV With Quoted Fields to JSON Safely](https://ferkesh.net/knowledgebase/article/ferkesh-csv-json-quoted-fields)
- [How to Review a WooCommerce Product CSV Before Import](https://ferkesh.net/knowledgebase/article/review-woocommerce-catalog-csv-before-import)

## Official references

- [MySQL fixed-point DECIMAL and NUMERIC types](https://dev.mysql.com/doc/refman/8.4/en/fixed-point-types.html)

Ferkesh Hosting. Last reviewed November 27, 2026.
