Convert an attribute to a specified base.