roundFiguresToString

Return to directory of Todd's CASA extensions

This function rounds a floating point or integer value to a number of significant figures and outputs a string. See also roundFigures.

Usage:

au.roundFiguresToString(value, digits)
Inputs:
  • value: value to be rounded (between 1e-20 and 1e+20)
  • digits: number of significant digits, both before or after decimal point

Examples:

CASA <4>: au.roundFiguresToString(1145.13, 2)
  Out[4]: '1100'        

CASA <13>: au.roundFiguresToString(0.0013, 1)
  Out[13]: '0.001'    

-- ToddHunter - 2015-08-30

This topic: ALMA > TWikiUsers > ToddHunter > CasaExtensions > RoundFigures > RoundFiguresToString
Topic revision: 2015-08-30, ToddHunter
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback