Page 1 of 1

Conditional Formatting using Numeric Operands with a Decimal

Posted: Fri Sep 03, 2010 2:04 pm
by Crystole Roberts
Hello,

I am trying to set up conditional formatting on a field assigned to a variable, TRRatio_USA, that needs to be formatted as a percentage; therefore, true value is a decimal, such as 1.85. So, I entered: TRRatio_USA . So, in an attempt to workaround, I tried several things:
1.) I multiplied my variable by 100 displaying 0 decimal places, and turned the field to the expression: {TRRatio_USA + "%"}, and changed the format to General. Set the conditional formatting to TRRatio_USA < 85. This results in the value being displayed with several decimal places, and the formatting is not enabled for values less than 85. I then formatted the field to number, displaying zero decimals, and had the same results. I realize this is because adding the "%" makes the field a string.
2. So, I changed the field to reference the variable only, rather than the expression including the "%", and I am able to format as needed. But how do I get the "%" sign on?

Conditional Formatting using Numeric Operands with a Decimal

Posted: Mon Sep 06, 2010 2:03 am
by Alex K.
Hello,

In nhis case evrything is correct. This is not the error of the designer but .NET. You need to use the casting of types:
TRRatio_USA < (decimal).85

Thank you.

Conditional Formatting using Numeric Operands with a Decimal

Posted: Sat Oct 23, 2010 5:36 pm
by Crystole Roberts
Hello,

Thank you for your help with this before. However, I now have a new issue. I have a control that is formatted as a percentage; however, I do not want to display the negative (-) sign when the value is negative, as I have a dollar difference value right next to it. So, I tried to use the conditional formatting to multiply the value of the expression by -100, rather than 100, but now the control is not picking up the text formatting of being a percent with zero decimals. How can I accomplish this? Thank you for your help. You guys almost always solve our issues! Thanks!