Class Formats

java.lang.Object
io.keikai.axyra.sheets.format.Formats

public final class Formats extends Object
Number / date formatting with Excel format codes — the engine's formatting pipeline exposed as stateless helpers (no workbook needed).
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    format(double value, String code)
    Format a numeric value with an Excel format code, e.g.
    static String
    format(double value, String code, String localeTag)
    Format a numeric value with an Excel format code under a BCP-47 display locale: month / weekday names, AM/PM markers, and decimal / thousands separators localize, e.g.
    parse(String text)
    Classify user-typed cell text the way Excel does when a value is entered into a cell: numbers (including "50%", "$1,234.56", "1/2", "1.5E3"), dates and times (as Excel serials), booleans, formulas (leading =), and plain text.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • format

      public static String format(double value, String code)
      Format a numeric value with an Excel format code, e.g. format(1234.5, "#,##0.00") → "1,234.50", or format(45000, "yyyy-mm-dd") for a date serial.
    • format

      public static String format(double value, String code, String localeTag)
      Format a numeric value with an Excel format code under a BCP-47 display locale: month / weekday names, AM/PM markers, and decimal / thousands separators localize, e.g. format(1234.56, "#,##0.00", "de-DE") → "1.234,56". The format code itself stays invariant (. and , in the code always mean decimal / group flags). A null, empty, or unknown tag falls back to en-US.
    • parse

      public static ParsedValue parse(String text)
      Classify user-typed cell text the way Excel does when a value is entered into a cell: numbers (including "50%", "$1,234.56", "1/2", "1.5E3"), dates and times (as Excel serials), booleans, formulas (leading =), and plain text. Reference: ECMA-376 Part 1 §18.17.2.3 (data types).