Decimal separator and decimals settings ignored when aggregating decimal fields

Created on 29 May 2016, over 8 years ago
Updated 26 June 2023, over 1 year ago

Problem/Motivation

Have view with a decimal field, say A.
Choosing comma as decimal separator.
Choosing 2 in Scale selector (number of digits to the right of the separator).
Result without aggregation correct. All values display with 2 decimals and comma as decimal point.

With aggregation the sum of A display with decimal point and 14 digits left of the separator.
Seams that the up-summing totally ignore the option I chose for the field A in views field selector.

Steps to reproduce

  1. Add a Decimal field, multi value, to a content type
  2. Add a node of that content type, with two values in the decimal field
  3. Create a view for that content type
  4. Enable aggregation
  5. Add the Decimal field to the view and set the Decimal marker to 'Comma' .
  6. In the Aggregation settings, set the Aggregation type to 'Sum'

Proposed resolution

Revert accidental commit of field handlers on aggregation field settings within get_aggregation_info() from this commit:
https://git.drupalcode.org/project/drupal/-/commit/684b4a036e736b16d21a1...

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 5 hours ago

Created by

πŸ‡ΈπŸ‡ͺSweden chrotto

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

  • Needs screenshots

    The change alters the user interface, so before and after screenshots should be added to document the UI change. Make sure to capture the relevant region only. Use a tool such as Aviary on Windows or Skitch on Mac OS X.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024