08-18-2018 01:13
08-18-2018 01:13
Hi
I'm trying to get a simple app going, howerver im new to json, im trying to read a simple barometer reading, but i cant figure out i can return a simple string/int value.
barData.text = JSON.stringify(data.bar) + " mb";
im getting {"pressure":1005} mb,
Is there something like Unstringify, without the pressure label.
thx,
Chris
Answered! Go to the Best Answer.
08-18-2018 02:54
08-18-2018 02:54
This object have the member pressure. You can just write
barData.text = parseInt(bar.pressure) + " mb";
(parseInt removes number after the decimal Point)
08-18-2018 02:54
08-18-2018 02:54
This object have the member pressure. You can just write
barData.text = parseInt(bar.pressure) + " mb";
(parseInt removes number after the decimal Point)
08-18-2018 04:31
08-18-2018 04:31
Thanks Hquick60,
That works,