<< Click to Display Table of Contents >> Navigation: Professional > Database > Significant Figures in EQuIS |
EQuIS uses two functions for handling significant figures.
•SIGNIFICANT_FIGURES_GET – This function examines the textual representation of a numeric value and computes how many significant figures that value contains. For example, the number of significant figures in 0.50 is two, whereas the number of significant figures in 10.50 is four.
•SIGNIFICANT_FIGURES – This function takes a numeric value and converts it to text using the specified number of significant figures, which can optionally display using scientific notation. For example, the number 0.5 displayed with two significant figures is 0.50, whereas the same number displayed with four significant figures is 0.5000.
These functions may be used within other functions, queries, and reports. The standard ANALYTICAL_RESULTS function uses these functions in computing the REPORT_RESULT_TEXT value that is returned to the user. The DT_RESULT.RESULT_NUMERIC value is used for calculations (unit conversions, etc.). Once the final numeric value has been calculated (REPORT_RESULT_VALUE), the function will call SIGNIFICANT_FIGURES_GET and pass in DT_RESULT.RESULT_TEXT. This will compute the number of significant figures in the original result value. The function will then pass the calculated value and the calculated number of significant figures into SIGNIFICANT_FIGURES to produce REPORT_RESULT_TEXT. Therefore, the REPORT_RESULT_TEXT field should be populated with the proper numeric value for the result (after unit conversions, etc.) displayed with the same number of significant figures as the original result.
Note: The report parameter, Non-Detect Multiplier, does not impact the number of significant figures in a report. However, the Detection Limit and Format Code parameter options, e.g. DT_RESULT.METHOD_DETECTION_LIMIT, can determine the number of significant figures in the REPORT_RESULT_TEXT column of the report output. If a Format Code is selected, e.g. #,##0.######, significant figures will not be maintained in REPORT_RESULT_TEXT. |
SQL Server Examples |
select equis.significant_figures_get('10.50'); |
select equis.significant_figures(0.5,4,0); |
It is possible to customize the handling of significant figures. To do so, consider one of the below.
•Change SIGNIFICANT_FIGURES_GET to have a more elaborate system of rules for determining the number of significant figures in a value.
•Add a separate column to DT_RESULT for explicitly storing the number of significant figures. Then in ANALYTICAL_RESULTS, have it use the value in that column (instead of computing the number of significant figures using SIGNIFICANT_FIGURES_GET).
Before making any changes to the data structure or functions, consult your database administrator.
Copyright © 2023 EarthSoft, Inc • Modified: 25 Mar 2022