Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max length for decimal numbers #141

Closed
scoumbourdis opened this issue Dec 15, 2012 · 3 comments
Closed

Max length for decimal numbers #141

scoumbourdis opened this issue Dec 15, 2012 · 3 comments
Labels

Comments

@scoumbourdis
Copy link
Owner

For more you can take a look at the post http://www.grocerycrud.com/forums/topic/1167-maxlength-of-decimal-fields/

bzuro added a commit to bzuro/grocery-crud that referenced this issue Sep 18, 2013
Fixed issue scoumbourdis#141, so that decimal numbers have enough max-length in
input field, accounting for the decimal character.
@dodge107
Copy link

dodge107 commented Aug 5, 2014

Hi,

This bug is still in the code. Here is my fix.

around line 2206 of the main lib.
after this line: if(!empty($field_info->db_max_length))

add this:
if(strstr($field_info->db_max_length, ','))
{
$field_info->db_max_length = str_replace(',', '.', $field_info->db_max_length);
$field_info->db_max_length = ceil($field_info->db_max_length);
}

@bvrignaud
Copy link
Contributor

I have the same problem with FLOAT.
Why don't you apply the PR ?

@scoumbourdis scoumbourdis added bug and removed task labels Sep 13, 2015
scoumbourdis added a commit that referenced this issue Sep 13, 2015
#141 - Max length for decimal numbers
@scoumbourdis
Copy link
Owner Author

Thanks @bvrignaud for the reminder. I did miss that.

Pull request merged with small changes to master: #327

Closing this ticket. This will be released to public at the next version 1.5.3

Cheers
Johnny

luiscoms pushed a commit to luiscoms/grocery-crud that referenced this issue Jan 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants