Hi, I am doing a project. In my project, I am display on an lcd screen a number, for example 27.0
With the aid of buttons, I want to change the values of any position of the number being displayed on the screen. For example, change the 7 in 27.0 to 0, then displaying 20.0 on the screen My code works, the only problem I have is that when I turn the 2 in the 27.0 to a zero, the amount of significant digits drops by one on the display. For example, it would display 7.0, but I want it to display 07.0 (I want it to retain 3 significant digits even after the change.) My initial data type is a double.
Hi, I am doing a project. In my project, I am display on an lcd screen a number, for example 27.0
With the aid of buttons, I want to change the values of any position of the number being displayed on the screen. For example, change the 7 in 27.0 to 0, then displaying 20.0 on the screen My code works, the only problem I have is that when I turn the 2 in the 27.0 to a zero, the amount of significant digits drops by one on the display. For example, it would display 7.0, but I want it to display 07.0 (I want it to retain 3 significant digits even after the change.) My initial data type is a double.
Hi, I am doing a project. In my project, I am display on an lcd screen a number, for example 27.0
With the aid of buttons, I want to change the values of any position of the number being displayed on the screen. For example, change the 7 in 27.0 to 0, then displaying 20.0 on the screen My code works, the only problem I have is that when I turn the 2 in the 27.0 to a zero, the amount of significant digits drops by one on the display. For example, it would display 7.0, but I want it to display 07.0 (I want it to retain 3 significant digits even after the change.) My initial data type is a double.
You can program it. Make a string from the number with dtostrf and add a '0' if needed.
Or use the sprintf(), but that is a problem... the sprintf() for the Arduino has floating point disabled, so you have to convert it to integer values.