Mapping for Bytes/percentage format

I have the same question. Just as we can update the format from Kibana. How to specify the same through PUT mapping API?
Every property has format field, I tried specifying 'bytes' but it throws an exception. Thanks.