Skip to content

Kirby 4.5.0

num

Checks for a valid number / numeric value (float, int, double)

V::num($value): bool

Parameters

Name Type Default
$value * mixed

Return type

bool

In your code

if(V::num(1.0)) {
  echo 'Yay, valid!';
}

In fields

fields:
  example:
    label: Example field
    type: text
    validate: num