Class SimpleQuantityFormat

  • All Implemented Interfaces:
    Serializable, Cloneable, QuantityFormat, tech.uom.lib.common.function.Parser<CharSequence,​Quantity>

    public class SimpleQuantityFormat
    extends AbstractQuantityFormat
    A simple implementation of QuantityFormat
    The following pattern letters are defined:
    Chart shows pattern letters, date/time component, presentation, and examples.
    Letter Quantity Component Presentation Examples
    n Numeric value Number 27
    u Unit Text m
    ~ Mixed radix Text 1 m; 27 cm
    Pattern letters are usually repeated, as their number determines the exact presentation:
    • Text: For formatting, if the number of pattern letters is 4 or more, the full form is used; otherwise a short or abbreviated form is used if available. For parsing, both forms are accepted, independent of the number of pattern letters.

    • Number: For formatting, the number of pattern letters is the minimum number of digits, and shorter numbers are zero-padded to this amount. For parsing, the number of pattern letters is ignored unless it's needed to separate two adjacent fields.

    • Mixed Radix: The Mixed radix marker "~" is followed by a character sequence acting as mixed radix delimiter. This character sequence must not contain "~" itself or any numeric values.
    Since:
    2.0
    Version:
    2.2, Jan 7, 2024
    See Also:
    Serialized Form