Ng-if syntax for a float value

I would like to set the color depending on the value:

how should I formulate the query. Unfortunately I can’t find any documentation where I can read.

Would be grateful for a CODE suggestion and for a documentation recommendation
I’ve tried a lot but without success.

The value is always displayed in green regardless of the value

<div * ng-if = "itemValue (EnBw_Aktuell) <'0.0'">
    <h3 style = "color: LIMEGREEN;">
    {{'% .0f' | sprintf: itemValue ('EnBw_Aktuell')}} <br>
</div>

Is this ( (SOLVED) Habpanel widget background color )what your are looking for ?

Hi thank you for asking.

In itself a very simple task that I could not (yet) solve properly.
If the value EnBw_Aktuell is less than zero I want to display the number in green and if the value is greater than zero then red.

My comparison *ng-if = “itemValue (EnBw_Aktuell) <‘0.0’” does not deliver the desired result. So there is still something wrong. I suspect there is a problem with the variable types / number types. My attempts have not yet delivered a result.
However, there is no documentation where I can read.
That’s why I asked for a solution and also for good documentation on the topic.

Erm… HTML, CSS, Bootstrap and AngularJS. There is plenty of documentation out there on these topics. For HABPanel itselft this is a good place to start: HABPanel Development & Advanced Features: Start Here!

I would try something like this:

<h3 ng-style="{ color: parseFloat(itemState('EnBw_Aktuell')) < 0 ? 'red' : 'green' }">...</h3>

I guess “EnBw_Aktuell” is the name of the item you want to check, so you have to pass it to “itemState” (“itemValue” might also work but it’s deprecated) as a string. Also, “itemState” gives you a string, so you cant use “<” to compare it.