Decimal Places

Decimal Places

How do I make the variable [Gross_Margin] in the example below, calculate to only 2 decimal places. The field is a percentage set to 2 decimal places, however when the calculation is performed the value is many times greater than 2 decimals. The problem is, when I edit a record and try and save it, I get an error message saying round up to 2 decimal places.

//input.Gross_Margin = ((input.salesvalue - input.costvalue) / input.salesvalue * 100);

Martyn

martynhale