Value widget - surprising action

a = 11; b = 799
String c = String (a) + “,” + String (b); (comma)
sending c to widget value displays 11,799

String c = String (a) + “.” + String (b); (dot)
displays 11.8

it is OK?

erm… I’m inclined to say no! Question is whether this is a blynk issue or a arduino issue! Have you gotten these values from the serial monitor or from some vpins in the app?
Regardless of the app: if the serial displays this ‘issue’ its an arduino error, if the serial doesnt’display this but the app does, then its a blynk issue.

Serial.print( C ); is Ok

Gave this some though and actually this makes sense! The widget display Numeric values NOT strings (with a few exceptions) so when you send a string that can be interpreted as a value its converted, “its a feature not a bug”. I’m uncertain how to omit this issue. Maybe @Dmitriy knows how?

this is not a problem, it is a surprise
I lost an hour to find the reason the wrong display of data in skech

Ican imagine your surprise I would have been too, but its conform blynk operation.

iOS or Android?

Yes, this is correct. However, this was done initially for labeled value displays only as it has formatting options. But seems this logic also were moved to regular value display.

Value/Labeled widgets always parse received value as float, that’s why dot delimiter produces such behavior. If the value could not be parsed as int or float - it will be shown as text. Float values will be formatted as #.## - that’s why in your case you have .8 as a result. Maybe we’ll add decimals formatting for more control on this behavior to this widgets in future like in slider and some other widgets.

You are not correct, value display always had this feature, as it also support values mapping, for example.

OK I understand
next question about displaying numbers in widget value
float test1 = 12.345;
Blynk.virtualWrite (19, test1);
Serial.println (test1, 3);
Print serial is OK 12.345
widgets (value and labeled value) show
value

app 2.26.4 lib 0.5.3 local server 0.38.3-java8

This last float display issue sees a resurgence of a bug in the older ESP core… Search and ye shall find :stuck_out_tongue_winking_eye: There has be a couple of recent topics on it already. Make sure you are updated.

2 Likes

fix with core 2.4.1 esp8266
thx Gunner

1 Like