There are three possible ways to accomplish this. The first one is the best method to use, but the others will work as well.
- Method 1:
- Wire the double-precision value into a Number to Fractional String VI. The bottom input to this VI is the precision, or number of digits after the decimal place. The output of this VI should be a string containing the number with the correct significant digits.
- To convert this back into a double-precision number, simply use a Frac/Exp String to Number VI. The output will be the number with the correct precision. This method also works for arrays of double-precision numbers. See attached VI.
- Method 2:
- Wire the double-precision value to a numeric indicator.
- Right-click on the indicator and go to either Properties or Format Precision, depending on the data type (array or single number).
- Under Format and Precision, make sure the Precision Type is set to Significant Digits and then change the Digits numeric to the desired number.
- Click OK to save this configuration. Now you can create a local variable off of the indicator and use the value out from it.
- Method 3:
- Multiply the double-precision number by a multiple of 10 to move the decimal place.
- Use the Round to Nearest VI to round the number off to an integer.
- Then divide by the same multiple of 10 to move the decimal point back.
To download VIs that demonstrate how to set a double-precision value to three significant digits for each method, refer to the
LabVIEW: Set the Significant Digits of a Double-Precision Wire Community example.