View Source XlsxReader.Styles (xlsx_reader v0.8.6)

Utility functions and types to deal with cell styles

Summary

Types

Matches the text representation of a cell value

Knwon cell styles for which type conversion is supported

Cell styles for which type conversion is supported

Types

Link to this type

custom_format_matcher()

View Source
@type custom_format_matcher() :: String.t() | Regex.t()

Matches the text representation of a cell value

@type custom_formats() :: %{optional(String.t()) => String.t()}
@type known_style_type() ::
  :string | :number | :percentage | :date | :time | :date_time | :unsupported

Knwon cell styles for which type conversion is supported

@type style_type() :: known_style_type() | String.t()

Cell styles for which type conversion is supported

@type style_types() :: XlsxReader.Array.t(style_type())
Link to this type

supported_custom_formats()

View Source
@type supported_custom_formats() :: [{custom_format_matcher(), known_style_type()}]

Functions

Link to this function

get_style_type(num_fmt_id, custom_formats \\ %{}, supported_custom_formats \\ [])

View Source
@spec get_style_type(String.t(), custom_formats(), supported_custom_formats()) ::
  style_type() | nil

Guesses the type of a cell based on its style.

The type is:

  1. looked-up from a list of "standard" styles, or
  2. guessed from a list of default supported custom formats, or
  3. guessed from a list of user-provided supported custom formats.

If no type could be guessed, returns nil.