How values are parsed from the CLI to commands that create/update yaml (e.g. new/write).
yq attempts to parse values intelligently, e.g. when a number is passed it - it will assume it's a number as opposed to a string. yq will not alter the representation of what you give. So if you pass '03.0' in, it will assume it's a number and keep the value formatted as it was passed in, that is '03.0'.
The --tag flag can be used to override the tag type to force particular tags.
Default behavior
Integers
Given
yqnewkey3
results in
key:3
Given a formatted number
yqnewkey03
results in
key:03
yq keeps the number formatted as it was passed in.
Float
Given
yqnewkey"3.1"
results in
Note that quoting the number does not make a difference.