catull
catull
Provided a PR, see #6378.
This issue can be seen as an extension of #346, I realize it now.
If you want precision, you have to adapt your processing a little. With this input ```json { "data": [ 150.40, 140.51 ] } ``` you can apply this transformation: ```...
Try this, to see the changes applied: ``` { "round1": sum (.data), "round2": floor (sum (.data) * 100) / 100, "roundnum": floor (sum (.data) * 100 + 0.5) / 100...
Actually, it is correct for positive sums. @jerrybyte Try this: Input: ```json { "data": [ [ 150.40, 140.51 ], [ 150.40, 140.51, 10.32 ], [ 150.40, 140.51, 10.32, 15.83 ]...
This one works ``` def squashNulls (obj) from-json (replace (replace (replace (replace (string ($obj), "\\\"[^\"]+\\\":null", ""), ",,", ","), ",}", "}"), ",]", "]")) squashNulls (.) ``` It could be reduced to...
I checked, see https://github.com/schibsted/jslt/blob/master/core/src/main/java/com/schibsted/spt/data/jslt/impl/BuiltinFunctions.java#L931 Java Regexp Pattern are used internally, but they do not support positional patterns. I'll open an issue for that.
My original algorithm did not support an initial property of an object being null. It only worked if the null property was in the middle or the end. > string...
@samer1977 By the way, what is the policy on null values in arrays ? ```json [ null, 2, 7, { "a": 1, "b": 2 }] ``` Should that null be...
@samer1977 Can you give an example ?