You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
Alex Bikeyev
committed
docs: add dimensions reference with channel semantics, sequential vs set types, and COLORMAP function
Add comprehensive dimensions.md reference covering dimension declaration, set vs seq types, channel system with @.value/@.fill/@.font_color, and dimensional item references. Expand formatting.md with rule-driven formatting section, conditional formatting examples, and COLORMAP function for gradient-based color maps. Add dimensions.md as first entry in Reference navigation.
Copy file name to clipboardExpand all lines: docs/reference/formatting.md
+96-10Lines changed: 96 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,55 @@
1
1
# Formatting patterns
2
2
3
-
OM Core uses number and currency formatting patterns based on the Unicode Common Locale Data Repository (CLDR). This page explains the origin of the syntax and the pattern types OM Core supports.
3
+
OM Core uses number and currency formatting patterns based on the Unicode Common
4
+
Locale Data Repository (CLDR). This page explains the origin of the syntax and
5
+
the pattern types OM Core supports.
4
6
5
-
This page is about **number and currency display patterns**, not visual styles such as font color or background fill. Visual styles are set through channels like `@.fill` and `@.font_color`. See the [Scripting reference](scripting.md) for how to use style channels.
7
+
This page is about **number and currency display patterns**, not visual styles such
8
+
as font color or background fill. Visual styles are set through channels like
9
+
`@.fill` and `@.font_color`. See the [Scripting reference](scripting.md) for how
10
+
to use style channels.
11
+
12
+
## Rule-driven formatting
13
+
14
+
All formatting in OM Core is rule-driven. A format string is attached to a cell
15
+
or slice through the `@.format_number` channel using the same `rule` syntax as
The format or style is recomputed automatically when the underlying values change,
42
+
so the visual presentation always stays consistent with the model state.
6
43
7
44
## Source
8
45
9
46
The formatting syntax in OM Core originates from CLDR number and currency patterns:
10
47
11
48
[Number and currency patterns — CLDR](https://cldr.unicode.org/translation/number-currency-formats/number-and-currency-patterns)
12
49
13
-
CLDR defines locale-aware patterns for presenting numbers, currencies, percentages, and compact numbers. OM Core uses these patterns as the basis for formatting values in views.
50
+
CLDR defines locale-aware patterns for presenting numbers, currencies,
51
+
percentages, and compact numbers. OM Core uses these patterns as the basis for
52
+
formatting values in views.
14
53
15
54
## Pattern types
16
55
@@ -23,7 +62,9 @@ CLDR supports four general-purpose number patterns:
23
62
24
63
## Pattern characters
25
64
26
-
In CLDR patterns, characters such as `.` and `,` are placeholders. The actual decimal and grouping symbols are determined by the active locale. Literal characters that are not placeholders must be quoted.
65
+
In CLDR patterns, characters such as `.` and `,` are placeholders. The actual
66
+
decimal and grouping symbols are determined by the active locale. Literal
67
+
characters that are not placeholders must be quoted.
27
68
28
69
Common pattern characters:
29
70
@@ -47,28 +88,36 @@ CLDR currency patterns may include:
47
88
48
89
## Compact numbers
49
90
50
-
CLDR also defines compact patterns for values like `1M` or `1 million`. These patterns vary significantly by language and may include plural categories.
91
+
CLDR also defines compact patterns for values like `1M` or `1 million`. These
92
+
patterns vary significantly by language and may include plural categories.
51
93
52
94
## OM Core usage
53
95
54
-
When you set a format string in OM Core, you can write either a CLDR-style pattern or an OM Core preset expression.
96
+
When you set a format string in OM Core, you can write either a CLDR-style
97
+
pattern or an OM Core preset expression.
55
98
56
99
### CLDR-style patterns
57
100
58
-
A CLDR-style pattern is a locale-aware pattern resolved against the cell or cube locale:
101
+
A CLDR-style pattern is a locale-aware pattern resolved against the cell or cube
This means the same model can be displayed correctly across different locales without changing the underlying data.
108
+
This means the same model can be displayed correctly across different locales
109
+
without changing the underlying data.
65
110
66
111
### OM Core preset expressions
67
112
68
-
A preset expression is a higher-level, readable directive that the engine maps to a concrete format. Presets are useful when you want explicit control over decimals, grouping, negative numbers, and zero display without writing a raw CLDR pattern:
113
+
A preset expression is a higher-level, readable directive that the engine maps to
114
+
a concrete format. Presets are useful when you want explicit control over
115
+
decimals, grouping, negative numbers, and zero display without writing a raw CLDR
0 commit comments