0

Styled text

Hello

How to style text negative positive and zero? there is a formula when there are two values, but you still need to add a text color when there is zero

let AA := 'field name'
if AA >0 then
styled(text(AA), " ")
else 
styled(Text(AA), " ")
end 

3 replies

null
    • Fred
    • 2 mths ago
    • Reported - view

    For me, I like to use a switch if I have start embedding ifs within ifs.

    You can try:

    switch true do
        case 'field name' = 0:
            styled(text(AA), "green")
        case 'field name' < 0:
            styled(text(AA), "red")
        case 'field name' > 0:
            styled(text(AA), "orange")
    end
    
      • iliper LTD
      • iliper_LTD
      • 2 mths ago
      • Reported - view

      Hello  

      My formula looks like this:
      let AA := 'RESULT ';
      switch true do
      case AA = 0:
          styled(text(AA), "gray")
      case AA < 0:
          styled(text(AA), "red")
      case AA > 0:
          styled(text(AA), "green")
      end;

      But I don't have a switch using the formula field, and as expected, it doesn't work )

      Can you do this for the formula field so there are three colours: zero, negative, and positive?

      Thanks

      • Fred
      • 2 mths ago
      • Reported - view

       Is RESULT a number? What happens if you put RESULT in place of AA?

Content aside

  • Status Answered
  • 2 mths agoLast active
  • 3Replies
  • 50Views
  • 2 Following