Unwanted trailing zeros in commerce_price:number fields in views

Created on 7 April 2020, over 4 years ago
Updated 30 September 2024, 3 months ago

When adding a (commerce_price:number) field in views there's no way to remove the unwanted trailing zeros after the decimal point in the field's Configure field window.

🐛 Bug report
Status

Fixed

Version

2.16

Component

Price

Created by

🇦🇺Australia the_glitch

Live updates comments and jobs are added and updated live.
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.

  • 🇹🇭Thailand AlfTheCat

    +1 for re-opening this, as I can confirm this is still an issue. In my case, I'm trying to make a "Total sales" block that sums the "Total price" field on orders. When using aggregation, I get results like:
    Total: 10, 320.000000

    There is no way to change the formatter or apply decimal settings.

  • 🇹🇭Thailand AlfTheCat

    For those bumping into this problem, a dirty work around is to install the views_simple_math_field, entering the formula of @yourfield*1 and then setting the rounding to your needs.

Production build 0.71.5 2024