org.apache.poi.ss.usermodel

## Class ExcelNumberFormat

- java.lang.Object
- - org.apache.poi.ss.usermodel.ExcelNumberFormat

-     public class ExcelNumberFormat
      extends java.lang.Object

  Object to hold a number format index and string, for various formatting evaluations

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExcelNumberFormat(int idx, java.lang.String format)` Use this carefully, prefer factory methods to ensure id/format relationships are not broken or confused.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ExcelNumberFormat` | `from(Cell cell, ConditionalFormattingEvaluator cfEvaluator)`
    `static ExcelNumberFormat` | `from(CellStyle style)`
    `java.lang.String` | `getFormat()`
    `int` | `getIdx()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExcelNumberFormat

          public ExcelNumberFormat(int idx,
                                   java.lang.String format)

      Use this carefully, prefer factory methods to ensure id/format relationships are not broken or confused. Left public so `ConditionalFormattingRule.getNumberFormat()` implementations can use it.
      Parameters:
        `idx` - Excel number format index, either a built-in or a higher custom # mapped in the workbook style table
        `format` - Excel number format string for the index

  - ### Method Detail

    - #### from

          public static ExcelNumberFormat from(CellStyle style)

      Parameters:
        `style` -
      Returns:
        null if the style is null, instance from style data format values otherwise

    - #### from

          public static ExcelNumberFormat from(Cell cell,
                                               ConditionalFormattingEvaluator cfEvaluator)

      Parameters:
        `cell` - cell to extract format from
        `cfEvaluator` - ConditionalFormattingEvaluator to use, or null if none in this context
      Returns:
        number format from highest-priority rule with a number format, or the cell style, or null if none of the above apply/are defined

    - #### getIdx

          public int getIdx()

      Returns:
        Excel number format index, either a built-in or a higher custom # mapped in the workbook style table

    - #### getFormat

          public java.lang.String getFormat()

      Returns:
        Excel number format string for the index

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.