sigfigs#
- sigfigs(x, sigfigs=4, SI=False, sep=False, keepints=False)#
Return a string representation of variable x with sigfigs number of significant figures
Note:
sc.sigfig()
andsc.sigfigs()
are aliases.- Parameters:
Examples:
x = 3432.3842 sc.sigfig(x, SI=True) # Returns '3.432k' sc.sigfig(x, sep=True) # Returns '3,432' vals = np.random.rand(5) sc.sigfig(vals, sigfigs=3)
New in version 3.0.0: changed default number of significant figures from 5 to 4; return list rather than tuple; changed SI suffixes to uppercase