How I limit the quantity of decimals in a input number of laravelCollective?
Asked
Active
Viewed 1.1k times
4
-
Could you expend on what you would like to do exactly? Maybe with an exemple. – Wistar Nov 30 '15 at 20:55
2 Answers
13
In the Laravel using the FORM, you need change the parameter 'step'.
{!! Form::number('preco', null, ['class' => 'form-control','step' => '0.1']) !!}

Floern
- 33,559
- 24
- 104
- 119

Otho garcia
- 141
- 2
- 8
3
The Laravel between validation rule is actually pretty powerful and can handle decimal values as well. So there's no need to use regex just do this:
'required|between:0,99.99'
Answer taken from here: Laravel validate decimal 0-99.99

Community
- 1
- 1

clonerworks
- 641
- 1
- 6
- 16