maxlength of decimal fields
- Single Page
Posted 13 December 2012 - 20:03 PM
Anyway if a field in SQL is defined as Decimal (5,2) then GroceryCRUD sets the maxlength to '5,2'...
E.g.
<input id="field-price_single_eur" name="price_single_eur" type="text" value="120.00" class="numeric" maxlength="5,2">
It would be nice if it set it to 5+2+1 (for the decimal place) e.g. maxlength="8"
Or am I doing it wrong?
Thanks!
Posted 15 December 2012 - 18:09 PM
Thanks
Johnny
Posted 14 April 2013 - 18:57 PM
I have the very same problem.
Posted 18 September 2013 - 01:05 AM
The correct way would be 5+1, because the 2 decimal places are incorporated in the 5. In other words 5 is the total number of digits without the decimal character.
I have send you a pull request on github for the fix.