round function in jq doesn't work.
$ jq '10.01 | round'
jq: error: round/0 is not defined at <top-level>, line 1:
10.01 | round
jq: 1 compile error
$ jq --help
jq - commandline JSON processor [version 1.5-1-a5b5cbe]
What I need to do?
Seems like round is unavailable in your build. Either upgrade jq or implement round using floor:
def round: . + 0.5 | floor;
Usage example:
$ jq -n 'def round: . + 0.5 | floor; 10.01 | round'
10
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With