Enum Class BigDecimals.DecimalPolicy

java.lang.Object
java.lang.Enum<BigDecimals.DecimalPolicy>
app.babylon.text.BigDecimals.DecimalPolicy
All Implemented Interfaces:
Serializable, Comparable<BigDecimals.DecimalPolicy>, Constable
Enclosing class:
BigDecimals

public static enum BigDecimals.DecimalPolicy extends Enum<BigDecimals.DecimalPolicy>
Policy used to resolve ambiguous decimal separators.

A decimal is ambiguous when the text contains exactly one comma or period, that separator is followed by exactly three digits, and no other separator signal is present. For example 100,379 may mean either 100379 or 100.379. A grouping space, non-breaking space, narrow non-breaking space, or a second separator removes the ambiguity.

  • Enum Constant Details

    • AUTO

      public static final BigDecimals.DecimalPolicy AUTO
      Infer separators from the text. When a single comma is ambiguous, treats it as a grouping separator. A single ambiguous period is treated as a decimal separator.
    • PERIOD_DECIMAL

      public static final BigDecimals.DecimalPolicy PERIOD_DECIMAL
      Treat period as the decimal separator and comma as a grouping separator.
    • COMMA_DECIMAL

      public static final BigDecimals.DecimalPolicy COMMA_DECIMAL
      Treat comma as the decimal separator and period as a grouping separator.
  • Method Details

    • values

      public static BigDecimals.DecimalPolicy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BigDecimals.DecimalPolicy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromLocale

      public static BigDecimals.DecimalPolicy fromLocale(Locale locale)
      Returns a decimal policy from the decimal separator used by the supplied locale.
      Parameters:
      locale - locale to inspect
      Returns:
      locale-derived decimal policy, or AUTO when no comma or period decimal separator is defined