# Gimp.Unit.format_string

    @accepts(unicode, Gimp.Unit)
    @returns(unicode)
    def format_string(format, unit):
        # Python wrapper for gimp_unit_format_string()

The format string supports the following percent expansions:

* `%n`: Name (long label) * `%a`: Abbreviation (short label) * `%%`: Literal percent * `%f`: Factor (how many units make up an inch) * `%y`: Symbol (e.g. `''` for `GIMP_UNIT_INCH`)

Since 2.8

format

  A printf-like format string which is used to create the unit string.

unit

  A unit.

Returns