diff --git a/src/Traits/BootstrapContainerTrait.php b/src/Traits/BootstrapContainerTrait.php index 4808ab2..36e9a36 100644 --- a/src/Traits/BootstrapContainerTrait.php +++ b/src/Traits/BootstrapContainerTrait.php @@ -154,6 +154,20 @@ public function addInteger(string $name, $label = null): NetteTextInput ->addRule(Form::INTEGER); } + /** + * @param string|Html|null $label + * @return TextInput + */ + public function addFloat(string $name, $label = null): NetteTextInput + { + + return $this->addText($name, $label) + ->setNullable(BootstrapForm::$allwaysUseNullable) + ->setHtmlType('number') + ->setHtmlAttribute('step', 'any') + ->addRule(Form::Float); + } + /** * @param string|Html|null $label * @param string[]|null $items