DynamicBuilders.DynamicFloat.FloatFormatter.Builder


class DynamicBuilders.DynamicFloat.FloatFormatter.Builder


Builder to create FloatFormatter objects.

Summary

Public constructors

Public functions

DynamicBuilders.DynamicFloat.FloatFormatter

Builds an instance with values accumulated in this Builder.

DynamicBuilders.DynamicFloat.FloatFormatter.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setGroupingUsed(groupingUsed: Boolean)

Sets whether grouping is used for the formatter.

DynamicBuilders.DynamicFloat.FloatFormatter.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setMaxFractionDigits(maxFractionDigits: @IntRange(from = 0) Int)

Sets maximum number of fraction digits for the formatter.

DynamicBuilders.DynamicFloat.FloatFormatter.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setMinFractionDigits(minFractionDigits: @IntRange(from = 0) Int)

Sets minimum number of fraction digits for the formatter.

DynamicBuilders.DynamicFloat.FloatFormatter.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setMinIntegerDigits(minIntegerDigits: @IntRange(from = 0) Int)

Sets minimum number of integer digits for the formatter.

Public constructors

Builder

Added in 1.0.0
Builder()

Public functions

build

Added in 1.0.0
fun build(): DynamicBuilders.DynamicFloat.FloatFormatter

Builds an instance with values accumulated in this Builder.

setGroupingUsed

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
fun setGroupingUsed(groupingUsed: Boolean): DynamicBuilders.DynamicFloat.FloatFormatter.Builder

Sets whether grouping is used for the formatter. Defaults to false if not specified. If grouping is used, digits will be grouped into digit groups using a separator. Digit group size and used separator can vary in different countries/regions. As an example, for locale en_US, the following is equal to * DynamicString.constant("1,234")

  DynamicFloat.constant(1234)
      .format(
          new FloatFormatter.Builder()
                          .setGroupingUsed(true).build());

setMaxFractionDigits

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
fun setMaxFractionDigits(maxFractionDigits: @IntRange(from = 0) Int): DynamicBuilders.DynamicFloat.FloatFormatter.Builder

Sets maximum number of fraction digits for the formatter. Defaults to three if not specified. minimumFractionDigits must be <= maximumFractionDigits. If the condition is not satisfied, then minimumFractionDigits will be used for both fields.

setMinFractionDigits

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
fun setMinFractionDigits(minFractionDigits: @IntRange(from = 0) Int): DynamicBuilders.DynamicFloat.FloatFormatter.Builder

Sets minimum number of fraction digits for the formatter. Defaults to zero if not specified. minimumFractionDigits must be <= maximumFractionDigits. If the condition is not satisfied, then minimumFractionDigits will be used for both fields.

setMinIntegerDigits

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
fun setMinIntegerDigits(minIntegerDigits: @IntRange(from = 0) Int): DynamicBuilders.DynamicFloat.FloatFormatter.Builder

Sets minimum number of integer digits for the formatter. Defaults to one if not specified. If minIntegerDigits is zero and the -1