Added __format__ method and test