forallpeople icon indicating copy to clipboard operation
forallpeople copied to clipboard

Error using .to() converting ft to meters

Open m-conway opened this issue 3 years ago • 1 comments

Works fine converting from m to ft but I get this warning going the other way:

/.../forallpeople/init.py:164: UserWarning: No unit defined for 'm' on 1.000 ft. if not unit_match: warnings.warn(f"No unit defined for '{unit_name}' on {self}.") 304.800 mm

m-conway avatar May 23 '21 10:05 m-conway

Hi @m-conway,

I think I should update the API so that this works. The intended approach was to use .to() for converting to non-SI units and to use .si() to revert the instance to SI units. However, I find myself often wanting to use .to() to go both ways, especially when I am writing code that where I do not know if I am expecting an SI unit or a US unit. I will see if there is a quick way to implement this...

connorferster avatar Oct 30 '21 20:10 connorferster