I need to add a float field to a json, I'm doing somthing like :
echo '{"field":' '"value"}' | jq --arg id 21841453190106 --arg price 1.2 '.+ {$price}'
getting:
{
"field": "value",
"price": "1.2"
}
I'd like to have:
{
"field": "value",
"price": 1.2
}
thanks
EDIT: thanks to 0stone0 :
echo '{"field":' '"value"}' | jq --arg id 21841453190106 --argjson price 1 '.+ {$price}'
gives:
{
"field": "value",
"price": 1
}
any way to have
{
"field": "value",
"price": 1.0
}
?