Modify Cell Content - Round Data
Jump to navigation
Jump to search
This rule modifies the selected statistics to round the data to a specified number of decimal places, for use when exporting results (e.g., to Excel). This rule does not modify the number of decimal places that appear in Q (see Formatting Cells for instructions for modifying the number of decimals in Q).
Example
In this example, the data has been rounded to 0 decimal places.
Technical details
- This rule rounds to the nearest multiple of 10. For example, with no decimal places, it rounds to the nearest integer.
- From time-to-time you may experience inconsistent results due to the influence that your operating system settings and your computer's process have on rounding.
- Significance tests are conducted on the results prior to the modification.
- You can choose to modify all numeric statistics shown on the table, or you can select a set of statistics to modify.
- You can also choose whether or not marginal statistics (Statistics - Below and Statistics - Right) are included in the modification.
- A footnote is added to explain which statistics have been modified in this way.
How to apply this rule
For the first time in a project
- Select the table(s)/chart(s) that you wish to apply the rule to.
- Start typing the name of the Rule into the Search features and data box in the top right of the Q window.
- Click on the Rule when it appears in the QScripts and Rules section of the search results.
OR
- Select Automate > Browse Online Library.
- Choose this rule from the list.
Additional applications of the rule
- Select a table or chart that has the rule and any table(s)/chart(s) that you wish to apply the rule to.
- Click on the Rules tab (bottom-left of the table/chart).
- Select the rule that you wish to apply.
- Click on the Apply drop-down and choose your desired option.
- Check New items to have it automatically applied to new items that you create. Use Edit > Project Options > Save as Template to create a new project template that automatically uses this rule.
Removing the rule
- Select the table(s)/chart(s) that you wish to remove the rule from.
- Press the Rules tab (bottom-right corner).
- Press Apply next to the rule you wish to remove and choose the appropriate option.
How to modify the rule
- Click on the Rules tab (bottom-left of the table/chart).
- Select the rule that you wish to modify.
- Click Edit Rule and make the desired changes. Alternatively, you can use the JavaScript below to make your own rule (see Customizing Rules).
JavaScript
▶ Show Code
See also
- User Input for Rules for technical information on Rules.
- Rule Online Library for other examples of Rules.
- Table JavaScript and Plot JavaScript for the JavaScript that is used to write custom rules.
- JavaScript for information about the JavaScript programming language.