Help in lambda

Hi there, could anybody help in most probably a simple question which I could not solve myself. I just wanted to add several actions into the else clause in below function. I tried several different options with, but all failed. Thanks for any help - JJ

    lambda: |-
      static int i = 0;
      i++;
      if ((i % 2) == 0)      
        if (id(power_solar).state <= 0) 
          it.printf("nSun");  
        else      
          it.printf("%.3f",(id(power_solar).state) / 1000);         
      else
        if (id(power_export).state <= 0) 
          it.printf("nExp");  
        else
          it.printf("%.3f",(id(power_export).state) / 1000);       

Lamdas are C++, so multiple statement are enclosed between { and }, e.g.

      if ((i % 2) == 0) {     
        if (id(power_solar).state <= 0) {
          it.printf("nSun");  
        } else {
          it.printf("%.3f",(id(power_solar).state) / 1000); 
        }
        another_statement();
       }

You can also enclose single statements, for clarity and consistency.

thank you so much !!