4x20 LCD, how to do not display decimals

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

4x20 LCD, how to do not display decimals

#1 Post by mackowiakp » 14 Sep 2019, 08:13

To limit the number of displayed (and not always needed) characters on a 4x20 LCD, It would be needed to be able to display some numbers without a decimals. Or with only one decimal place. For example, when displaying atmospheric pressure, no decimals display is needed. Similarly, when showing the temperature, one decimal place is enough.
I query Domoticz SQLite DB for necessary parameters and then send it to quad dummy sensor in nodeMCU using LUA script. This script cut off for example decimals in value of atmospheric pressure and send it in this form to nodeMCU equipped with 4x20 LCD. That implicates event:

Code: Select all

EVENT: Temp-Baro#Baro=1036.00
As You can see, [Temp-Baro#Baro] variable has two zeros as decimals. But I want to display it on 2x4 LCD without decimals. Is it possible? If yes, how can I do it?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: 4x20 LCD, how to do not display decimals

#2 Post by grovkillen » 14 Sep 2019, 09:01

Set the number of decimals in the task setting...
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: 4x20 LCD, how to do not display decimals

#3 Post by mackowiakp » 14 Sep 2019, 09:21

I already have „zero” decimals in sensor value definition

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: 4x20 LCD, how to do not display decimals

#4 Post by grovkillen » 14 Sep 2019, 09:26

And it still display those decimals on the display? If so, what version are you on?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: 4x20 LCD, how to do not display decimals

#5 Post by mackowiakp » 14 Sep 2019, 10:38

Yes, it still display decimals. Build mega-20190827 (normal). But remember that there is still dummy sensor issue with dummy sensor, listed in GitHub. I dont know for sure, but maybe it is related to this issue too?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: 4x20 LCD, how to do not display decimals

#6 Post by grovkillen » 14 Sep 2019, 11:01

If you change to three decimals, as a test, what happens?

PS. The log might not obey to the decimal setting, it's up to the plugin to decide that.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: 4x20 LCD, how to do not display decimals

#7 Post by mackowiakp » 14 Sep 2019, 11:14

OK. I will do several tests, including directly with %eventvalue% and post again.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: 4x20 LCD, how to do not display decimals

#8 Post by mackowiakp » 14 Sep 2019, 11:31

Its crazy.... After power on/off it started work properly. Formerly I rebooted device from "Tools" menu and it still displayed wrong number of decimals. Now temperature has on decimal position and pressure no decimals. Correct ! THX for Your support !

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: 4x20 LCD, how to do not display decimals

#9 Post by grovkillen » 14 Sep 2019, 11:33

Good to hear. Sometimes a real power cycle is needed.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests