mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-10 16:55:40 +00:00
486 B
486 B
Number modulo - int
If the lhs and rhs are ints then the expression will be calculated with ints.
Given a sample.yml file of:
a: 13
b: 2
then
yq '.a = .a % .b' sample.yml
will output
a: 1
b: 2
Number modulo - float
If the lhs or rhs are floats then the expression will be calculated with floats.
Given a sample.yml file of:
a: 12
b: 2.5
then
yq '.a = .a % .b' sample.yml
will output
a: !!float 2
b: 2.5