Implemented as_unit function for quantities + test