Fixed a small bug that caused _Quantity.to_compact to fail when magnitude is 0
This commit is contained in:
parent
4dd7413dc6
commit
5a7e57ad30
@ -317,7 +317,7 @@ class _Quantity(SharedRegistryObject):
|
||||
>>> (1e-2*ureg('kg m/s^2')).to_compact('N')
|
||||
<Quantity(10.0, 'millinewton')>
|
||||
"""
|
||||
if self.unitless:
|
||||
if self.unitless or self.magnitude==0:
|
||||
return self
|
||||
|
||||
SI_prefixes = {}
|
||||
|
Loading…
Reference in New Issue
Block a user