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:
<informaltable pgwide="1" frame="none" role="enum"> <tgroup cols="2"><colspec colwidth="1*"/><colspec colwidth="8*"/> <tbody> <row> <entry>% f</entry> <entry>Factor (how many units make up an inch)</entry> </row> <row> <entry>% y</entry> <entry>Symbol (e.g. "''" for GIMP_UNIT_INCH)</entry> </row> <row> <entry>% a</entry> <entry>Abbreviation</entry> </row> <row> <entry>% s</entry> <entry>Singular</entry> </row> <row> <entry>% p</entry> <entry>Plural</entry> </row> <row> <entry>%%</entry> <entry>Literal percent</entry> </row> </tbody> </tgroup> </informaltable>
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.