number

inline fun number(builderAction: HexFormat.NumberHexFormat.Builder.() -> Unit)(source)

Provides a scope for configuring the number property.

The receiver of the builderAction is the number property. Thus, inside the braces one can configure its options directly. This convenience function is intended to enable the configuration of multiple options within a single block. For example, the snippet:

val format = HexFormat {
number {
prefix = "&#x"
suffix = ";"
removeLeadingZeros = true
}
}

is equivalent to:

val format = HexFormat {
number.prefix = "&#x"
number.suffix = ";"
number.removeLeadingZeros = true
}

Refer to NumberHexFormat for details about the available format options, their impact on formatting and parsing results, and their default settings.

Since Kotlin

1.9

Parameters

builderAction

The function that is applied to the number property, providing a scope for directly configuring its options.


Defines HexFormat.number of the format being built.

Refer to NumberHexFormat for details about the available format options, their impact on formatting and parsing results, and their default settings.

Since Kotlin

1.9