Quantities: compareTo, hashCode and toString