Round a number in a control
Formulas are stored in fields and are displayed in the controls that are bound to those fields. When designing a form, you can use a formula in a text box, rich text box, or expression box to round to the nearest integer a value that users type into a control on the form.
Note You should use an expression box only if you do not want to use the rounded value in another calculation or save it as part of the form, because expression boxes only display data and do not store it.
- In design mode, double-click the control where you want to create the rounding formula.
- On the Data tab in the Control Properties dialog box, click Insert Formula .
Note To create the formula by using the field's properties, right-click the field in the Data Source task pane, and then click Properties.
- In the Insert Formula dialog box, click Insert Function.
- In the Categories list in the Insert Function dialog box, click Math.
- In the Functions list, click round, and then click OK.To always round a number up, use the ceiling() function. To always round a number down, use the floor() function.
- In the Formula box, double-click the text in parentheses.
- In the Data source list in the Select a Field or Group dialog box, click the field whose value you want to round.
Note The information in this topic may not apply if you are working with a form designed using Microsoft Office InfoPath 2003 without the service pack installed. Learn more