@meshmakers/octo-meshboard 3.5.480 → 3.5.500

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -240,6 +240,7 @@ interface KpiWidgetConfig {
240
240
  suffix?: string;
241
241
  icon?: string;
242
242
  trend?: 'up' | 'down' | 'neutral';
243
+ decimalPlaces?: number;
243
244
  // For persistent query mode
244
245
  queryMode?: 'simpleCount' | 'aggregation' | 'groupedAggregation';
245
246
  queryValueField?: string;
@@ -247,6 +248,21 @@ interface KpiWidgetConfig {
247
248
  }
248
249
  ```
249
250
 
251
+ Numbers are formatted with the `de-AT` locale. Without `decimalPlaces` a fractional value shows two
252
+ fraction digits and a whole number none (38.9 -> `38,90`, 46 -> `46`). With `decimalPlaces` every numeric
253
+ value shows exactly that many (`decimalPlaces: 1`: 38.9 -> `38,9`, 46 -> `46,0`). In a seed, set it in the
254
+ widget `Config` JSON, e.g. `{"valueMode":"formula","formula":"...","decimalPlaces":1}`; the configuration
255
+ dialog offers it as *Decimal Places* (AB#7686). Valid values are the JSON numbers 0-3 (integers); anything
256
+ else (a string such as `"1"`, a fraction, a negative value, 4 or more, other types) falls back to the automatic
257
+ format. Unlike the heatmap's `decimalPlaces` (a maximum, default 2), the KPI value is an exact digit count and
258
+ unset means automatic; both widgets format through the shared `formatWidgetNumber` (`utils/widget-data-utils.ts`,
259
+ cached `Intl.NumberFormat` instances). With `decimalPlaces` set, a text value is parsed strictly: only a string
260
+ that is a complete number (`"12"`, `" 12 "`, `"1e3"`) is formatted, anything else (`"12 kWh"`, an ISO date,
261
+ `"12,5"`) is shown unchanged. Without `decimalPlaces` the previous lenient parsing stays (`"12 kWh"` -> `12`).
262
+ A negative value that rounds to zero is shown without a sign (`-0.04` with 1 -> `0,0`). The setting also
263
+ applies to KPI children of a widget group (`childTemplate.staticConfig.decimalPlaces`, also offered in the
264
+ widget-group configuration dialog).
265
+
250
266
  ### Gauge Widget
251
267
  Displays a numeric value as arc, circular, linear, or radial gauge.
252
268