This should really be a utility function in wodkunit.cpp (if it isn't already)