LCD setup question

I’m a python noob, but i want something changed to the output on the LCD of my emonpi.
The below text from the python-script should generate an output of a rounded value, instead of a decimal value, and negative values should be shown as an Absolute value with IN (for positive values, or OUT (in case the value was negative)

if page == 3:
if r.get(“feed1”) is not None:
lcd[0] = feed1_name + ‘:’ + r.get(“feed1”) + feed1_unit
lcd[0] = feed1_name + ‘:’ + “—”

    if r.get("feed2") is not None:
        lcd[1] = feed2_name + ':'  + r.get("feed2") + feed2_unit 
        lcd[1] = feed2_name + ':'  + "---"

How to accomplish this?

Hello @peter_duyck, perhaps try:

Python round() Function


Python Number abs() Method

before calling abs you will want to check if its positive or negative and display the right text.

When your combining numbers and strings you need to add a str(1.234) around the number