$field->toInt()
Converts the field value into a proper integer
$field->toInt(int $default = 0): int
Parameters
Name | Type | Default | Description |
---|---|---|---|
$default |
int |
Default value if the field is empty |
Return type
int
Example
<?= $page->mynumber()->toInt() ?>