Link to home
Start Free TrialLog in
Avatar of TBSupport
TBSupport

asked on

If, Then Ranges in C#

Hello:

Below is an if, then statement in C# code.  How do I get the syntax for the “1030.00” piece to say: “If TotalAmountProcessedInSqFt is between 1.0 and 1.5, then return 1030.00”.  What would be the syntax for that?

Thanks!

TBSupport


if (_TOTALAMOUNTPROCESSEDINSQFT_<1.0)
{
          return "515.00";
}

if (_TOTALAMOUNTPROCESSEDINSQFT_ > 1.0 and _TOTALAMOUNTPROCESSEDINSQFT_
< 1.5)
{
          return "1030.00";
}

//if (__1_290.Trim().ToLower() == "x")
//{
//       return "1290.00";
//}

//if (__1_545.Trim().ToLower() == "x")
//{
//       return "1545.00";
//}

//if (__2_060.Trim().ToLower() == "x")
//{
//       return "2060.00";
//}

//if (__2_575.Trim().ToLower() == "x")
//{
//       return "2575.00";
//}

//if (__3_090.Trim().ToLower() == "x")
//{
//       return "3090.00";
//}

return "";

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>“If TotalAmountProcessedInSqFt is between 1.0 and 1.5, then return 1030.00”.

if((TotalAmountProcessedInSqFt >= 1.0) && (TotalAmountProcessedInSqFt <= 1.5)
  {
  return "1030.00";
  }
Avatar of TBSupport
TBSupport

ASKER

Thanks, for the comments, everyone!  I should be talking to the client, this morning.  I will let you know how that goes.

TBSupport