I have the following JSON:
{"vote_average": 7.0, "vote_count": 310}
And I am trying to get the value of "vote_average" (7.0) using the following code:
OutputTo "Temp_VOTE_AVERANGE"
json_select "vote_average"
SayRest
OutputTo "vote_average"
SayOutput "Temp_VOTE_AVERANGE"
Set "Temp_VOTE_AVERANGE"
However, the code only shows me the integer value (7) instead of the decimal value (7.0). What am I doing wrong?
You probably are doing nothing wrong here, because JSON's possibilities allow for numbers to be represented in decimal, scientific, or integer notation. The command json_select obviously can read only integer numbers and stops before the decimal point. Therefore I think you have found a bug in Mp3tags JSON implementation.
Meanwhile, after testing this issue with a script, I think this is not a bug but an undocumented feature of the command json_select. This comand reads all three number types decimal, scientific and integer correctly, but it delivers always only the rounded integer part of the number to the current input and strips off the decimal part. @Florian propably could mention this feature in the documentation of json_select to avoid further confusion with this topic.