# How to Get Decimal Value from JSON Using Script

**URL:** https://community.mp3tag.de/t/how-to-get-decimal-value-from-json-using-script/64260
**Category:** Web Sources Discussion
**Created:** [March 31, 2024, 10:13pm UTC](https://community.mp3tag.de/t/how-to-get-decimal-value-from-json-using-script/64260 "2024-03-31T22:13:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![adolfojos](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/bc79bd/32.png) [@adolfojos](https://community.mp3tag.de/u/adolfojos)
#### Post date: [March 31, 2024, 10:13pm UTC](https://community.mp3tag.de/t/how-to-get-decimal-value-from-json-using-script/64260/1 "2024-03-31T22:13:14Z")

</div>

**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?**

---

<div class="post-metadata">

### Author: ![yorickausyps](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/y/f6c823/32.png) [@yorickausyps](https://community.mp3tag.de/u/yorickausyps)
#### Post date: [November 11, 2024, 1:39pm UTC](https://community.mp3tag.de/t/how-to-get-decimal-value-from-json-using-script/64260/2 "2024-11-11T13:39:02Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![yorickausyps](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/y/f6c823/32.png) [@yorickausyps](https://community.mp3tag.de/u/yorickausyps)
#### Post date: [November 12, 2024, 12:37pm UTC](https://community.mp3tag.de/t/how-to-get-decimal-value-from-json-using-script/64260/3 "2024-11-12T12:37:12Z")

</div>

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.
