DynamicBuilders.DynamicFloat.FloatFormatter.Builder


public final class DynamicBuilders.DynamicFloat.FloatFormatter.Builder


Builder to create FloatFormatter objects.

Summary

Public constructors

Public methods

@NonNull DynamicBuilders.DynamicFloat.FloatFormatter

Builds an instance with values accumulated in this Builder.

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

Sets whether grouping is used for the formatter.

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

Sets maximum number of fraction digits for the formatter.

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

Sets minimum number of fraction digits for the formatter.

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

Sets minimum number of integer digits for the formatter.

Public constructors

Builder

Added in 1.0.0
public Builder()

Public methods

build

Added in 1.0.0
public @NonNull DynamicBuilders.DynamicFloat.FloatFormatter build()

Builds an instance with values accumulated in this Builder.

setGroupingUsed

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull DynamicBuilders.DynamicFloat.FloatFormatter.Builder setGroupingUsed(boolean groupingUsed)

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)
public @NonNull DynamicBuilders.DynamicFloat.FloatFormatter.Builder setMaxFractionDigits(@IntRange(from = 0) int maxFractionDigits)

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)
public @NonNull DynamicBuilders.DynamicFloat.FloatFormatter.Builder setMinFractionDigits(@IntRange(from = 0) int minFractionDigits)

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)
public @NonNull DynamicBuilders.DynamicFloat.FloatFormatter.Builder setMinIntegerDigits(@IntRange(from = 0) int minIntegerDigits)

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