Formify Docs

Decimal

Validate that a value is a decimal number with a fractional part.

Decimal

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.

Configuration

Config flagTypeDescription
decimalbooleanWhen true, requires the value to be a decimal number.

With useForm

const form = useForm({
  initialValues: { rate: '' },
  validationSchema: {
    rate: { decimal: true },
  },
});

With the V builder

import { V } from 'formify-js';

V.decimal();

Default message

ScenarioMessage
Value has no fractional partMust be a decimal number

Examples

ValueResult
'3.14'✅ Valid
'-0.5'✅ Valid
'10.0'✅ Valid
'10'❌ Invalid (no decimal point)

Notes

  • 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.

On this page