Skip to content

Commit 0246ce0

Browse files
Fix: HF-24 correct CHANGELOG issue ref and clarify docs adapter
- Replace wrong #1572 with correct #1145 (TEXT currency formats issue) - Add parser limitation note to trailing-quote adapter rule - Add NBSP note above console.log output example block
1 parent 8a2ab96 commit 0246ce0

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1313
- Added `maxPendingLazyTransformations` configuration option to control memory usage by limiting accumulated transformations before cleanup. [#1629](https://github.com/handsontable/hyperformula/issues/1629)
1414
- Added a new function: TEXTJOIN. [#1640](https://github.com/handsontable/hyperformula/pull/1640)
1515
- Added a new function: SEQUENCE. [#1645](https://github.com/handsontable/hyperformula/pull/1645)
16-
- Added a `stringifyCurrency` config option that lets you plug in a custom currency formatter for the `TEXT` function. [#1572](https://github.com/handsontable/hyperformula/issues/1572)
16+
- Added a `stringifyCurrency` config option that lets you plug in a custom currency formatter for the `TEXT` function. [#1145](https://github.com/handsontable/hyperformula/issues/1145)
1717

1818
### Fixed
1919

docs/guide/date-and-time-handling.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ const CURRENCY_RULES = [
144144
maximumFractionDigits: (match[1] || '.').length - 1,
145145
}),
146146
},
147-
// #,##0.00 "SYM" — trailing quoted symbol (e.g. zł, €)
147+
// #,##0.00 "SYM" — trailing quoted symbol (e.g. zł, €).
148+
// Note: HyperFormula's formula parser does not accept embedded double quotes
149+
// inside TEXT format strings. This rule is illustrative for callback usage
150+
// outside TEXT — to format PLN through TEXT, prefer "[$zł-415] #,##0.00".
148151
{
149152
pattern: /^#,##0(\.0+)?\s+"([^"]+)"$/,
150153
build: (match) => {
@@ -207,7 +210,11 @@ const hf = HyperFormula.buildFromArray([
207210
[12345.5, '=TEXT(A2, "[$zł-415] #,##0.00")'],
208211
[-1234.5, '=TEXT(A3, "$#,##0.00;($#,##0.00)")'],
209212
], options)
213+
```
214+
215+
Note: the actual return values from `Intl.NumberFormat` use non-breaking spaces (U+00A0) as locale-appropriate separators. The comments above show them as regular spaces for readability. Be aware when comparing strings programmatically.
210216

217+
```javascript
211218
console.log(hf.getCellValue({ sheet: 0, col: 1, row: 0 })) // "1.234,50 €"
212219
console.log(hf.getCellValue({ sheet: 0, col: 1, row: 1 })) // "12 345,50 zł"
213220
console.log(hf.getCellValue({ sheet: 0, col: 1, row: 2 })) // "($1,234.50)"

0 commit comments

Comments
 (0)