We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Extrafields with type float need specific number of decimals. The system always imposes 24,8 as length and always shows 2 decimals.
I did get it to work somehow:
In module core/actions_extrafields_inc.php
alter line 30: $extrasize=GETPOST('size','int'); to $extrasize=GETPOST('size','intcomma'); otherwise a float will always have length 24,8
in module core/class/extrafields.class.php: alter line 1543: if (!empty($value)) { $value=price($value);
to if (!empty($value)) { // $value=price($value); $sizeparts = explode(",",$size); $number_decimals = $sizeparts[1]; $value=price($value, 0, $langs, 0, 0, $number_decimals, '');
I'm not very good in php, hope this is right and can be merged into the core.
The text was updated successfully, but these errors were encountered:
Merge pull request #11420 from fbosman/develop
a65d3d0
Fix #11331 Bug: extrafields type double wrong length
Successfully merging a pull request may close this issue.
Bug
Extrafields with type float need specific number of decimals. The system always imposes 24,8 as length and always shows 2 decimals.
Environment
Expected and actual behavior
Extrafields with type float need specific number of decimals. The system always imposes 24,8 as length and always shows 2 decimals.
Suggested implementation
I did get it to work somehow:
In module core/actions_extrafields_inc.php
alter line 30: $extrasize=GETPOST('size','int');
to
$extrasize=GETPOST('size','intcomma');
otherwise a float will always have length 24,8
in module core/class/extrafields.class.php:
alter line 1543:
if (!empty($value)) {
$value=price($value);
to
if (!empty($value)) {
// $value=price($value);
$sizeparts = explode(",",$size);
$number_decimals = $sizeparts[1];
$value=price($value, 0, $langs, 0, 0, $number_decimals, '');
Suggested steps
I'm not very good in php, hope this is right and can be merged into the core.
The text was updated successfully, but these errors were encountered: