Virtual Pins double variable/format issue

hello, I observed the following and did not get a solution so far:
Situation:
Blynk 2.0
Virtual pin V_1 is formated as double in Blynk.Console with #.# and value range 0 to 100000

Case 1 delivers in datastream for V_1 “6231” which is correct

var1 = 6231;
Blynk.virtualWrite(V_1 ,var1);

Case 2 delivers in datastream for V_1 just “6” and not “6.2”

var1 = 6231;
double hilf = var1/1000.0;
Blynk.virtualWrite(V_1 ,hilf);

What I’m doing wrong ?

How are you viewing this?
Is it via a widget, or in the device > Datastreams tab in the web console?

Have you tried serial printing the same values?

Do you see any compiler warnings about mixed variable types?

Pete.

ohh my fault… I used an artificial number in my example . The real one was 5.037 … so my expectation was to see 5.0 but 5 was displayed . formating it to #.## showed the correct value. Sorry for that
Klaus

1 Like