Gimp.Unit.format_string

function format_string(format: String, unit: Gimp.Unit): String {
    // Gjs 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

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