Skip to content

format

const format: (value: unknown, spec: string) => string = builtins.format

Defined in: packages/pythonlib/src/index.ts:190

Convert a value to a formatted representation using a format specification.

Supports Python format spec mini-language for numbers and strings.

Parameters

ParameterTypeDescription
valueunknownThe value to format
specstringThe format specification string

Returns

string

The formatted string

See

Python format()