|
@@ -20,6 +20,11 @@ bucket_key = value - rem
|
|
|
|
|
|
From the rounding function above it can be seen that the intervals themselves **must** be integers.
|
|
|
|
|
|
+WARNING: Currently, values are cast to integers before being bucketed, which
|
|
|
+might cause negative floating-point values to fall into the wrong bucket. For
|
|
|
+instance, `-4.5` with an interval of `2` would be cast to `-4`, and so would
|
|
|
+end up in the `-4 <= val < -2` bucket instead of the `-6 <= val < -4` bucket.
|
|
|
+
|
|
|
The following snippet "buckets" the products based on their `price` by interval of `50`:
|
|
|
|
|
|
[source,js]
|