Gimp.Unit.format_string
Description: Reference for Gimp.Unit.format_string

### Function

# Gimp Unitformat_string

since: 2.8

#### Declaration [src]

    gchar*
    gimp_unit_format_string (
      const gchar* format,
      GimpUnit unit
    )

#### Description [src]

The `format` string supports the following percent expansions:

% f Factor (how many units make up an inch) % y Symbol (e.g. “”” for GIMP_UNIT_INCH) % a Abbreviation % s Singular % p Plural %% Literal percent

Available since: 2.8

#### Parameters

`format`

  Type: `const gchar*`

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

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`unit`

  Type: `GimpUnit`

  A unit.

#### Return value

Type: `gchar*`

A newly allocated string with above percent expressions replaced with the resp. strings for `unit`.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.