RosettaCodeData/Task/Arithmetic-numbers/Jq/arithmetic-numbers-1.jq
2023-07-01 13:44:08 -04:00

6 lines
185 B
Text

# For the sake of gojq
def _nwise($n):
def nw: if length <= $n then . else .[0:$n] , (.[$n:] | nw) end;
nw;
def lpad($len): tostring | ($len - length) as $l | (" " * $l)[:$l] + .;