positiveNumber
Accepts only non-negative (zero or positive) finite numbers.Validation Rules
- Must be a finite number (rejects
NaNandInfinity) - Must be greater than or equal to 0
- Rejects
-0(negative zero) - Accepts both integers and floats
Examples
Use Cases
- Prices and monetary amounts
- Distances and measurements
- Percentages (when non-negative)
- Ratings and scores
- Duration values
positiveInteger
Accepts only non-negative (zero or positive) finite whole numbers.Validation Rules
- Must be a finite number
- Must be a whole number (no decimal places)
- Must be greater than or equal to 0
- Rejects
-0(negative zero)
Examples
Use Cases
- Array lengths and indices
- Counts and quantities
- Pagination parameters
- Non-negative ID values
