---
title: "Preserve numeric precision at a validation boundary"
description: "Test a decimal input at its allowed minimum and maximum precision, including an over-precise value that must be rejected under the product contract."
canonical_url: "https://vostride.com/agent-library/forms-validation/numeric-limit-precision.md"
md_url: "https://vostride.com/agent-library/forms-validation/numeric-limit-precision.md"
content_kind: "recipe"
topic: "forms-validation"
---

# Preserve numeric precision at a validation boundary

Test a decimal input at its allowed minimum and maximum precision, including an over-precise value that must be rejected under the product contract.

## Risk

Formatting can round invalid input into a plausible visible value while saving a different amount. Specify the accepted precision and test data independently of the rendered preview.

## Fixtures

- A staging allocation form accepts percentages from 0.01 through 100.00 with at most two decimal places.
- The test-owned allocation is not connected to billing, payroll, or real financial transfers.
- The fixture oracle records 0.01 as the expected saved value and 0.001 as a rejected input.

## Steps

1. Open the allocation editor and enter 0.001 in the percentage field.
2. Save and verify an explicit precision or minimum-value error, with no successful saved-state indication.
3. Replace the entire value with 0.01 and verify the displayed preview represents one hundredth of one percent.
4. Save and reload the allocation detail; verify the saved percentage remains 0.01 rather than zero or one.
5. Open edit again and verify the input retains the same allowed value without multiplying or truncating it.

## Expected results

- The rejected input does not mutate the previously saved allocation, verified through its detail or an approved read-only check.
- The accepted lower-bound value persists exactly at the declared decimal precision.
- The preview, saved summary, and reopened editor represent the same numeric quantity.

## False-pass traps

- A rounded preview is not proof of the stored amount; inspect the saved value after reload.
- Locale-specific decimal punctuation must be fixed in the fixture rather than guessed during execution.

## Cleanup

- Delete the staging allocation or restore its original fixture value.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa first test](/docs/agent-qa/guides/first-test.md)
- [agent-qa web testing](/docs/agent-qa/guides/web-testing.md)

- [Forms and validation QA recipes](/agent-library/forms-validation.md)
- [Software factory QA library](/agent-library.md)
