I am using the adc on a esp8266 to read the battery voltage powering the unit, it is one lithium cell. I have scaled the raw adc reading to generate a realistic voltage reading and assigning it to a virtual pin. The ‘value display’ widget is showing 3 digits after the decimal. How do control this?
That is simple, by casting it back into an integer before calling virtualWrite. The widget will display any value you send.
More information here: https://www.arduino.cc/en/Reference/Cast
-edit with a small example:
float h = dht.readHumidity();
float c = dht.readTemperature();
int tempHumid = (int)h;
int tempTemp = (int)c;
String humid = (String)tempHumid;
String temp = (String)tempTemp;
humid += "%";
temp += "°C";
Blynk.virtualWrite(V13, humid);
Blynk.virtualWrite(V14, temp);
The above code goes from a float on the sensor, to an int for rounding up, to a String for displaying in the Value widget.