def getMassDifference(theo_mz: float, exp_mz: float, use_ppm: bool = True) -> float:
  """
    getMassDifference convenience function to easily switch the delta mass to either [ppm] or [Da] format.

    Given two masses, the calculated result will be the delta mass, in [ppm] if requested.
    The difference is **not** absolute.

    Parameters
    ----------
    theo_mz : float
        First mass
    exp_mz : float
        Second mass
    use_ppm : bool, optional
        switch from simple [Da] difference to [ppm], by default True

    Returns
    -------
    float
        [description]
    """
  error: float = (exp_mz - theo_mz)
  if use_ppm:
    error = error / (theo_mz * 1e-6)
  return error