Skip to content

$field->toFloat()

Converts the field value into a proper float

$field->toFloat(float $default = 0): float

Parameters

Name Type Default Description
$default float Default value if the field is empty

Return type

float

Aliases

You can use the following aliases for this field method in your template:

  • $field->float(…)

Example

<?= $page->mynumber()->toFloat() ?>