08-18-2018 01:13
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-18-2018 01:13
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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.

Accepted Solutions
08-18-2018 02:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-18-2018 02:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-18-2018 02:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-18-2018 04:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks Hquick60,
That works,

