As a test - try printing the string to the display.
ie - is it received incorrectly / converted incorrectly / sent as a float incorrectly...
Try and home in on the error.
Martin
Best tactic to decode JSON data..
-
- Valued Contributor
- Posts: 1551
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 138 times
- Been thanked: 739 times
Re: Best tactic to decode JSON data..
As a test I already did both.
The string is shown like it should, the float doesn't have decimals.
My guess is that the ILI9488 treats the float as an integer..?
The string is shown like it should, the float doesn't have decimals.
My guess is that the ILI9488 treats the float as an integer..?
-
- Valued Contributor
- Posts: 1607
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 357 times
- Been thanked: 565 times
-
- Valued Contributor
- Posts: 1551
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 138 times
- Been thanked: 739 times
Re: Best tactic to decode JSON data..
It's a silly question/thought...
If you are using the ILI9488 PrintNumber to display the value then it will, indeed, get converted to am integer. PrintNumber takes an Int (so just 16 bits too) - and no digits after the point!
Martin
If you are using the ILI9488 PrintNumber to display the value then it will, indeed, get converted to am integer. PrintNumber takes an Int (so just 16 bits too) - and no digits after the point!
Martin
Re: Best tactic to decode JSON data..
Oh my, you are right again.
My life is hell
After all this time still make these mistakes, I was pretty sure that it took a Float too.
Now I really have a problem because I want to show the the number with only one decimal and need to calculate with this number.
I will work it out, but it should be great to have a component that shows all kinds of numbers, I know this is a lot of work...
Will figure it out.
Thank you again Martin!
My life is hell

After all this time still make these mistakes, I was pretty sure that it took a Float too.
Now I really have a problem because I want to show the the number with only one decimal and need to calculate with this number.
I will work it out, but it should be great to have a component that shows all kinds of numbers, I know this is a lot of work...
Will figure it out.
Thank you again Martin!
-
- Valued Contributor
- Posts: 1551
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 138 times
- Been thanked: 739 times
Re: Best tactic to decode JSON data..
We got there in the end....
Easily done - see my post this evening about trying to fit 16 bits of data into a byte
Sometimes it just needs a different pair of eyes.
You could have a macro PrintFloat - that takes a float x (and possibly number of digits after dp) and a position - convert x to a string using FloatToString$ - then print the string....
Martin
Easily done - see my post this evening about trying to fit 16 bits of data into a byte

You could have a macro PrintFloat - that takes a float x (and possibly number of digits after dp) and a position - convert x to a string using FloatToString$ - then print the string....
Martin
-
- Valued Contributor
- Posts: 1607
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 357 times
- Been thanked: 565 times
Re: Best tactic to decode JSON data..
Hi
You can limit the number of decimal places
viewtopic.php?p=7248&hilit=number+of+de ... aces#p7248
You could use that for calculations, and then print.
Regards
You can limit the number of decimal places
viewtopic.php?p=7248&hilit=number+of+de ... aces#p7248
You could use that for calculations, and then print.
Regards