| Copyright | (c) 2025 |
|---|---|
| License | MIT |
| Maintainer | mschavinda@gmail.com |
| Safe Haskell | None |
| Language | GHC2021 |
Granite.Format
Description
Synopsis
Documentation
A declarative formatter applied to numeric tick / label values.
The Default behaves like the legacy formatter: scientific for very small or very large magnitudes, fixed-point with one decimal otherwise. The other constructors give the caller explicit control without needing to embed a Haskell function in the spec.
Constructors
| FormatDefault | |
| FormatPrecision Int | fixed point with the given decimals |
| FormatScientific Int | scientific notation with the given decimals |
| FormatPercent Int | percentage (multiplies by 100), with given decimals |
| FormatComma | integer with comma grouping (1,234,567) |
| FormatDateTime !Text | epoch-millisecond value formatted with the given strftime-style pattern; unsupported in this phase, returns the raw value. |
| FormatTemplate !Text | a printf-like template with a single "{}" placeholder. This phase only supports "{}" itself. |
| FormatSI | SI suffixes (1.2k, 3.4M) |