code: @Override
      public AttributedCharacterIterator formatToCharacterIterator(Object obj) {
          if (!(obj instanceof Number)) {
              throw new IllegalArgumentException();
          }
          Number number = (Number) obj;
          Amount amount = toAmount(number.doubleValue(), null, null);
          return super.formatToCharacterIterator(amount.getQty(), amount.getUnit());
      }
docs: {@inheritDoc}