Jump to content

Change Text Color based on Calc & Rounding Output


This topic is 7108 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello all,

i have a Question regarding the below Calculation. It is a Field where i want to display a Profit in Percent. If the Percent is below a certain Value, i like it to be red. To make this work, i had to define the profit_percent Field as a Text Field, otherwise the results would appear, but only black not color. However, if i make it a Text Field i cannot Round anymore to two Decimals. Does anybody know if i can fix it by using appropriate GetAsText or Number Functions? Only using the Round Function wont work.

 



Case ( 



IsEmpty ( sale ) or 

IsEmpty ( cost ) or 

IsEmpty ( min_buy_break ) or 

IsEmpty ( min_sale_break ) or 

IsEmpty ( sale_cur ) or 

IsEmpty (cost_cur) ; "" ;



Let(

[

profit = profit_amount / cost

profit_bad = GetAsText ( TextColor ( profit ; RGB ( 255 ; 0 ; 0 ) ) );

profit_good = GetAsText ( TextColor ( profit ; RGB ( 10 ; 140 ; 10 ) ) )];



Case(



profit > 20; profit_good & " %" ;  profit_bad & " %"

)

)

)



regards,

Overrider

Link to comment
Share on other sites

This topic is 7108 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.