Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Following #1558380: Add a price comparison condition, the amount entered in the price amount field gets truncated when the value is >= 1000.
In _commerce_price_rules_data_ui_element_validate() the amount is passed through number_format(). PHP docs state that
Note: PHP doesn't handle strings like "12,300.2" correctly by default.
Any value >= 1000 ends up being formatted to that which results in everything after the comma being dropped when rounding.
Comment | File | Size | Author |
---|---|---|---|
#1 | commerce-price_comparison-1828222-0.patch | 751 bytes | malberts |
Comments
Comment #1
malberts CreditAttribution: malberts commentedAdded 2 missing parameters as used by number_format elsewhere in commerce_price.module.
Comment #2
malberts CreditAttribution: malberts commentedChanging status.
Comment #4
rszrama CreditAttribution: rszrama commentedBug confirmed; letting testbot take another stab at this.
Comment #5
rszrama CreditAttribution: rszrama commented#1: commerce-price_comparison-1828222-0.patch queued for re-testing.
Comment #6
rszrama CreditAttribution: rszrama commentedCommitted. Thanks for the quick fix, malberts!
(And welcome to the committers log. : )