Verify Decimal Rounding in a Synthetic CSV Amount Import
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.
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
Official references
Ferkesh Hosting. Last reviewed .
Спасибі за відгук!