You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there! I'm wondering if there's currently a way to do something like the above, or what you recommend if one wanted to determine whether or not one is using a valid unit, or if you think it's better to rescue the exception. Thanks!
The text was updated successfully, but these errors were encountered:
@johnhutch I think you can use Unit.defined?("unitname") for this purpose.
Edit: Unit.defined? does not recognize prefixes so it won't work for those cases e.g. Unit.defined?('cm') is false but Unit.new('cm') will work.
Hey there! I'm wondering if there's currently a way to do something like the above, or what you recommend if one wanted to determine whether or not one is using a valid unit, or if you think it's better to rescue the exception. Thanks!
The text was updated successfully, but these errors were encountered: