Analogous to the "If less than 1 million, divide by 1 million" option, we should have the same for billions and trillions.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey’s picture

Status: Active » Needs review
FileSize
3.98 KB

Simple patch attached (copy/paste, search/replace).

herd45’s picture

I've tested and this works as expected

mstef’s picture

I'm a bit confused about the fact that the number 1 is under a million, under a billion, and under a trillion. How does this account for that?

drunken monkey’s picture

I'm a bit confused about the fact that the number 1 is under a million, under a billion, and under a trillion. How does this account for that?

The same as is currently done for the "If greater than …" options: only the most specific one will match, then the break 2; will prevent all other checks.
Of course, having both, e.g., "Greater than 1 million" and "Less than 1 billion" active will result in weird results (i.e., the latter only triggering if the value is also less than 1 million) – but why would a user configure that?
Generally, I see these options being used to have the same scale for all numbers, not only if they should be divided by a million, but also if the scale is a billion or a trillion. I.e., the use case is having just "Greater than or equal to X" and "Less than X" enabled and the others disabled.

Or did I misunderstand the question?

mstef’s picture

Assigned: Unassigned » drunken monkey
Status: Needs review » Reviewed & tested by the community

I added you as a maintainer. Feel free to commit this.

  • drunken monkey committed 1972914 on 7.x-1.x
    Issue #2474113 by drunken monkey: Added support for "less than a billion...
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

OK, thanks!
Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.