Decimal Validate that a value is a decimal number with a fractional part.
Validates that a value is a decimal number — it must include a fractional part separated by a . (dot). This validator is not optional; a plain integer fails.
Config flag Type Description decimalbooleanWhen true, requires the value to be a decimal number.
const form = useForm ({
initialValues: { rate: '' },
validationSchema: {
rate: { decimal: true },
},
});
import { V } from 'formify-js' ;
V . decimal ();
Scenario Message Value has no fractional part Must be a decimal number
Value Result '3.14'✅ Valid '-0.5'✅ Valid '10.0'✅ Valid '10'❌ Invalid (no decimal point)
Unlike numeric (which accepts integers), decimal requires the dot and a fractional part.
If you need to accept both integers and decimals, use numeric instead.