lib.utils.round_measurement

lib.utils.round_measurement(x, u=0.1, v=None, sigfigs=2, notation='auto')

Return string representation of input central value x with uncertainties u and v.

Parameters
  • x (float) – Central value.

  • u (float, default=0.1) – Upper uncertainty on x (positive).

  • v (float, default=None) – Lower uncertainty on v (negative). If None, only returns string representation for x and u.

  • sigfigs (int, default=2) – Number of digits to keep for the uncertainties (hence fixing number of digits for x).

Returns

  • xr (string) – String representation for central value x.

  • ur (string) – String representation for upper uncertainty u.

  • vr (string) – If v is not None, string representation for lower uncertainty v.