Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
jq 中的 round 函数不起作用。
$ 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]
我需要做什么?
似乎round在您的构建中不可用。升级 jq 或round使用floor:
round
floor
def round: . + 0.5 | floor;
使用示例:
$ jq -n 'def round: . + 0.5 | floor; 10.01 | round' 10