Skip to content

Format

[Source]

Provides functions for generating formatted strings.

  • fmt. Format to use.
  • prefix. Prefix to use.
  • prec. Precision to use. The exact meaning of this depends on the type, but is generally the number of characters used for all, or part, of the string. A value of -1 indicates that the default for the type should be used.
  • width. The minimum number of characters that will be in the produced string. If necessary the string will be padded with the fill character to make it long enough.
  • align. Specify whether fill characters should be added at the beginning or end of the generated string, or both.
  • fill. The character to pad a string with if is is shorter than width.
primitive val Format

Constructors

create

[Source]

new val create()
: Format val^

Returns


Public Functions

apply

[Source]

fun box apply(
  str: String val,
  fmt: FormatDefault val = FormatDefault,
  prefix: PrefixDefault val = PrefixDefault,
  prec: USize val = -1,
  width: USize val = 0,
  align: Align = AlignLeft,
  fill: U32 val = ' ')
: String iso^

Parameters

Returns


int[A: (Int & Integer[A] val)]

[Source]

fun box int[A: (Int & Integer[A] val)](
  x: A,
  fmt: FormatInt = FormatDefault,
  prefix: PrefixNumber = PrefixDefault,
  prec: USize val = -1,
  width: USize val = 0,
  align: Align = AlignRight,
  fill: U32 val = ' ')
: String iso^

Parameters

Returns


float[A: (Float & FloatingPoint[A] val)]

[Source]

fun box float[A: (Float & FloatingPoint[A] val)](
  x: A,
  fmt: FormatFloat = FormatDefault,
  prefix: PrefixNumber = PrefixDefault,
  prec: USize val = 6,
  width: USize val = 0,
  align: Align = AlignRight,
  fill: U32 val = ' ')
: String iso^

Parameters

Returns


eq

[Source]

fun box eq(
  that: Format val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: Format val)
: Bool val

Parameters

Returns