Latitude
Validate latitude coordinates in decimal degrees.
Validates that a value is a latitude coordinate in decimal degrees, in the range -90 to 90.
| Config flag | Type | Description |
|---|
latitude | boolean | When true, requires the value to be a valid latitude. |
const form = useForm({
initialValues: { lat: '' },
validationSchema: {
lat: { latitude: true },
},
});
import { V } from 'formify-js';
V.latitude();
| Scenario | Message |
|---|
| Value is not a valid latitude | Must be a valid latitude |
| Value | Result |
|---|
'51.5074' | ✅ Valid |
'-33.8688' | ✅ Valid |
'90' | ✅ Valid (pole) |
'91' | ❌ Invalid (out of range) |
'12.3N' | ❌ Invalid (direction suffix not accepted) |
- Values outside
-90 … 90 fail.
- Direction suffixes (
N/S) and degree symbols are not accepted — use plain decimal degrees.
- Combine with
latitude and longitude to validate coordinate pairs on separate fields.