Class NumberFormatOptions
java.lang.Object
de.xima.fc.form.common.number_format.NumberFormatOptions
Model class for the options used by our client-side $.xutil.numberFormat wrapper.
- Since:
- 8.2.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA simple builder forNumberFormatOptions.static enumWhether to pad decimals with zeroes, up to the number of decimal places.static enumSeparator to use to separate the integer part of the number from the fractional part.static enumHow to group digits in the integer part of the number.static enumSeparator to use between digit groups.static enumDefines the behavior of the input field when it is empty, i.e. no number is present.static enumDefines how to treat leading zeroes, e.g.static enumThe mode to use when rounding numbers.static enumWhere to place the signum sign that indicates whether a number is positive or negative.static enumWhere to place the unit sign, if any. -
Method Summary
Modifier and TypeMethodDescriptionstatic NumberFormatOptions.Builderbuilder()Creates a new builder forNumberFormatOptions.static NumberFormatOptions.BuilderCreates a new builder forNumberFormatOptionsthat applies the defaults to all options that are not set.Whether the number value should be changed when the mouse wheel is used while the input field is focused.Whether to pad decimals with zeroes, up to the number of decimal places, seedecimalPlaces().Maximum number of decimal places to display, see alsodecimalPaddingMode().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.How to group digits in the integer part of the number.Separator to use between digit groups.Defines the behavior of the input field when it is empty.booleaninthashCode()Defines how to treat leading zeroes, e.g. `003512`.The sign used to indicate that a number is negative.The sign used to indicate that a number is positive.The mode to use when rounding numbers.Whether to show the positive sign for positive numbers.Where to place the signum sign that indicates whether a number is positive or negative.Creates a new builder initialized with the values of this options instance.com.alibaba.fastjson.JSONObjectConverts this options instance to a JSON object that can be used by the client.unitSign()The unit sign to show before or after the number, seeunit sign placement.Where to place theunit sign, if any.The step to use when changing the value with the mouse wheel.
-
Method Details
-
changeValueOnWheel
Whether the number value should be changed when the mouse wheel is used while the input field is focused.- Returns:
- Whether to change the value on mouse wheel.
-
decimalPaddingMode
Whether to pad decimals with zeroes, up to the number of decimal places, seedecimalPlaces().- Returns:
- The decimal padding mode.
-
decimalPlaces
Maximum number of decimal places to display, see alsodecimalPaddingMode().- Returns:
- The number of decimal places.
-
decimalSeparator
Separator to use to separate the integer part of the number from the fractional part.- Returns:
- The decimal separator to use.
-
digitGroupMode
How to group digits in the integer part of the number.- Returns:
- The digit group mode.
-
digitGroupSeparator
Separator to use between digit groups.- Returns:
- The digit group separator.
-
emptyMode
Defines the behavior of the input field when it is empty.- Returns:
- The empty mode.
-
equals
-
hashCode
-
leadingZeroMode
Defines how to treat leading zeroes, e.g. `003512`.- Returns:
- The leading zero mode.
-
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
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
The mode to use when rounding numbers.- Returns:
- The rounding mode.
-
showPositiveSign
Whether to show the positive sign for positive numbers.- Returns:
- Whether to show the positive sign.
-
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
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
The unit sign to show before or after the number, seeunit sign placement.- Returns:
- The unit sign.
-
unitSignPlacement
Where to place theunit sign, if any.- Returns:
- The unit sign placement.
-
wheelStep
The step to use when changing the value with the mouse wheel. When null, uses an automatic step size based on the current settings and current value. Applicable only whenchangeValueOnWheel()is enabled.- Returns:
- The wheel step.
-
builder
Creates a new builder forNumberFormatOptions.- Returns:
- A new builder for
NumberFormatOptions.
-
builderWithDefaults
Creates a new builder forNumberFormatOptionsthat applies the defaults to all options that are not set.- Returns:
- A new builder for
NumberFormatOptions.
-
defaults
Creates a new options instance with default values.- Returns:
- A new options instance with default values.
-