Class NumberFormatOptions
- java.lang.Object
-
- de.xima.fc.form.common.number_format.NumberFormatOptions
-
public class NumberFormatOptions extends Object
Model class for the options used by our client-side $.xutil.numberFormat wrapper.- Since:
- 8.2.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNumberFormatOptions.BuilderA simple builder forNumberFormatOptions.static classNumberFormatOptions.DecimalPaddingModeWhether to pad decimals with zeroes, up to the number of decimal places.static classNumberFormatOptions.DecimalSeparatorSeparator to use to separate the integer part of the number from the fractional part.static classNumberFormatOptions.DigitGroupModeHow to group digits in the integer part of the number.static classNumberFormatOptions.DigitGroupSeparatorSeparator to use between digit groups.static classNumberFormatOptions.EmptyModeDefines the behavior of the input field when it is empty, i.e.static classNumberFormatOptions.LeadingZeroModeDefines how to treat leading zeroes, e.g.static classNumberFormatOptions.RoundingModeThe mode to use when rounding numbers.static classNumberFormatOptions.SignumSignPlacementWhere to place the signum sign that indicates whether a number is positive or negative.static classNumberFormatOptions.UnitSignPlacementWhere to place the unit sign, if any.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NumberFormatOptions.Builderbuilder()Creates a new builder forNumberFormatOptions.static NumberFormatOptions.BuilderbuilderWithDefaults()Creates a new builder forNumberFormatOptionsthat applies the defaults to all options that are not set.NumberFormatOptions.DecimalPaddingModedecimalPaddingMode()Whether to pad decimals with zeroes, up to the number of decimal places, seedecimalPlaces().IntegerdecimalPlaces()Maximum number of decimal places to display, see alsodecimalPaddingMode().NumberFormatOptions.DecimalSeparatordecimalSeparator()Separator to use to separate the integer part of the number from the fractional part.static NumberFormatOptionsdefaults()Creates a new options instance with default values.NumberFormatOptions.DigitGroupModedigitGroupMode()How to group digits in the integer part of the number.NumberFormatOptions.DigitGroupSeparatordigitGroupSeparator()Separator to use between digit groups.NumberFormatOptions.EmptyModeemptyMode()Defines the behavior of the input field when it is empty.booleanequals(Object o)inthashCode()NumberFormatOptions.LeadingZeroModeleadingZeroMode()Defines how to treat leading zeroes, e.g.CharacternegativeSign()The sign used to indicate that a number is negative.CharacterpositiveSign()The sign used to indicate that a number is positive.NumberFormatOptions.RoundingModeroundingMode()The mode to use when rounding numbers.BooleanshowPositiveSign()Whether to show the positive sign for positive numbers.NumberFormatOptions.SignumSignPlacementsignumSignPlacement()Where to place the signum sign that indicates whether a number is positive or negative.NumberFormatOptions.BuildertoBuilder()Creates a new builder initialized with the values of this options instance.com.alibaba.fastjson.JSONObjecttoJsonObject()Converts this options instance to a JSON object that can be used by the client.StringunitSign()The unit sign to show before or after the number, seeunit sign placement.NumberFormatOptions.UnitSignPlacementunitSignPlacement()Where to place theunit sign, if any.
-
-
-
Method Detail
-
decimalPaddingMode
public NumberFormatOptions.DecimalPaddingMode decimalPaddingMode()
Whether to pad decimals with zeroes, up to the number of decimal places, seedecimalPlaces().- Returns:
- The decimal padding mode.
-
decimalPlaces
public Integer decimalPlaces()
Maximum number of decimal places to display, see alsodecimalPaddingMode().- Returns:
- The number of decimal places.
-
decimalSeparator
public NumberFormatOptions.DecimalSeparator decimalSeparator()
Separator to use to separate the integer part of the number from the fractional part.- Returns:
- The decimal separator to use.
-
digitGroupMode
public NumberFormatOptions.DigitGroupMode digitGroupMode()
How to group digits in the integer part of the number.- Returns:
- The digit group mode.
-
digitGroupSeparator
public NumberFormatOptions.DigitGroupSeparator digitGroupSeparator()
Separator to use between digit groups.- Returns:
- The digit group separator.
-
emptyMode
public NumberFormatOptions.EmptyMode emptyMode()
Defines the behavior of the input field when it is empty.- Returns:
- The empty mode.
-
leadingZeroMode
public NumberFormatOptions.LeadingZeroMode leadingZeroMode()
Defines how to treat leading zeroes, e.g. `003512`.- Returns:
- The leading zero mode.
-
negativeSign
public Character negativeSign()
The sign used to indicate that a number is negative. Must be a single character. Must not be any of the numerical characters (digits).- Returns:
- The negative sign.
-
positiveSign
public Character positiveSign()
The sign used to indicate that a number is positive. Must be a single character. Must not be any of the numerical characters (digits).- Returns:
- The positive sign.
-
roundingMode
public NumberFormatOptions.RoundingMode roundingMode()
The mode to use when rounding numbers.- Returns:
- The rounding mode.
-
showPositiveSign
public Boolean showPositiveSign()
Whether to show the positive sign for positive numbers.- Returns:
- Whether to show the positive sign.
-
signumSignPlacement
public NumberFormatOptions.SignumSignPlacement signumSignPlacement()
Where to place the signum sign that indicates whether a number is positive or negative. See alsonegative signandpositive sign.- Returns:
- The signum sign placement.
-
toBuilder
public NumberFormatOptions.Builder toBuilder()
Creates a new builder initialized with the values of this options instance.- Returns:
- A new builder initialized with the values of this options instance.
-
toJsonObject
public com.alibaba.fastjson.JSONObject toJsonObject()
Converts this options instance to a JSON object that can be used by the client.- Returns:
- A JSON object representing this options instance.
-
unitSign
public String unitSign()
The unit sign to show before or after the number, seeunit sign placement.- Returns:
- The unit sign.
-
unitSignPlacement
public NumberFormatOptions.UnitSignPlacement unitSignPlacement()
Where to place theunit sign, if any.- Returns:
- The unit sign placement.
-
builder
public static NumberFormatOptions.Builder builder()
Creates a new builder forNumberFormatOptions.- Returns:
- A new builder for
NumberFormatOptions.
-
builderWithDefaults
public static NumberFormatOptions.Builder builderWithDefaults()
Creates a new builder forNumberFormatOptionsthat applies the defaults to all options that are not set.- Returns:
- A new builder for
NumberFormatOptions.
-
defaults
public static NumberFormatOptions defaults()
Creates a new options instance with default values.- Returns:
- A new options instance with default values.
-
-