Jet\Form_Field_Float / Form_Field::TYPE_FLOAT

Represents a form field for entering a decimal number. It has several specific parameters and methods.

The Jet\Form_Renderer_Field_Input_Number renderer is used to display the form field itself.

Default error codes

Code Meaning of
Form_Field::ERROR_CODE_EMPTY The field is marked as required and the value is not specified.
Form_Field::ERROR_CODE_OUT_OF_RANGE The numerical value is out of range.

Parameters

Parameter Type Required Meaning of
min_value float no Minimum value - optional.
max_value float no Maximum value - optional.
step float no Step by how much to change the value when using the arrows to change the value. Default: 0.01
places int no How many decimal places should the field operate with.
Method Meaning of
public getMinValue(
) : float|null
Returns the set minimum value.
public setMinValue(
float $min
) : void
Sets the minimum value.
public getMaxValue(
) : float|null
Returns the set maximum value.
public setMaxValue(
float $max
) : void
Returns the set maximum value.
public getStep(
) : float|null
Returns the step by how much the value should change when using the arrows to change the value.
public setStep(
float $step
) : void
Sets the step by how much the value should change when using the arrows to change the value.
public getPlaces(
) : int|null
Returns the number of decimal places to operate on the array.
public setPlaces(
int $places
) : void
Specifies how many decimal places to operate on the field.
Previous chapter
Jet\Form_Field_Int / Form_Field::TYPE_INT
Next chapter
Jet\Form_Field_Range / Form_Field::TYPE_RANGE