Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Added

- Added support for the new license key format. A proprietary key can now grant a subset of the library: a function your key does not include evaluates to a `#LIC!` error, and the matching parts of the API throw a `LicenseCapabilityMissingError`. `getAvailableFunctions()` and `getFunctionDetails()` describe only the functions your key includes. [#1728](https://github.com/handsontable/hyperformula/pull/1728)
- Added new functions: `TEXTBEFORE`, `TEXTAFTER`, `TEXTSPLIT`. [#1792](https://github.com/handsontable/hyperformula/pull/1792)

### Changed

Expand Down
2 changes: 2 additions & 0 deletions docs/guide/list-of-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,5 @@ A few of the rows above share a root cause worth stating once:
- **Rounding toward zero, not down.** `INT` discards the fractional part rather than rounding toward negative infinity, so it differs from Excel and Google Sheets for negative input only. `ROUNDDOWN`/`ROUNDUP` are unaffected — they are defined in terms of zero in all three.
- **`ISEVEN`/`ISODD` do not truncate.** They test the remainder of the value as given, so a value with a fractional part returns `FALSE` from *both*. Excel and Google Sheets truncate to an integer first, so exactly one of the two is always `TRUE`.
- **`CEILING.MATH`/`FLOOR.MATH` honour only `mode` = 1.** Excel and Google Sheets switch the negative-number rounding direction for any non-zero `mode`.
- **`TEXTSPLIT` returns `#N/A` where Excel returns `#CALC!`** when `ignore_empty` is on and nothing is left after the split (`=TEXTSPLIT(",,", ",", , TRUE)`), because HyperFormula has no `#CALC!` error.
- **`TEXTSPLIT` needs literal arguments to size its result.** The size of the spilled array depends on the text and the delimiters, and HyperFormula predicts it only when the text, the delimiters, `ignore_empty` and `match_mode` are literals (a number may carry a sign). With anything else, such as `=TEXTSPLIT(1+1, "")` or a cell reference, the formula is treated as returning one value and a longer result is `#VALUE!`, the same limitation as `SEQUENCE` with non-literal dimensions (`=SEQUENCE(1+1)`). Wrapped in another function, for example `=INDEX(TEXTSPLIT(A1, ","), 1, 2)`, it works for any argument.
3 changes: 3 additions & 0 deletions src/i18n/languages/csCZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'TBILLPRICE',
TBILLYIELD: 'TBILLYIELD',
TEXT: 'HODNOTA.NA.TEXT',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'TEXTJOIN',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'ČAS',
TIMEVALUE: 'ČASHODN',
TODAY: 'DNES',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/daDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'STATSOBLIGATION.KURS',
TBILLYIELD: 'STATSOBLIGATION.AFKAST',
TEXT: 'TEKST',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'TEKST.KOMBINER',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'TID',
TIMEVALUE: 'TIDSVÆRDI',
TODAY: 'IDAG',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/deDE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'TBILLKURS',
TBILLYIELD: 'TBILLRENDITE',
TEXT: 'TEXT',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'TEXTVERKETTEN',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'ZEIT',
TIMEVALUE: 'ZEITWERT',
TODAY: 'HEUTE',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/enGB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'TBILLPRICE',
TBILLYIELD: 'TBILLYIELD',
TEXT: 'TEXT',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'TEXTJOIN',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'TIME',
TIMEVALUE: 'TIMEVALUE',
TODAY: 'TODAY',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/esES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ export const dictionary: RawTranslationPackage = {
TBILLPRICE: 'LETRA.DE.TES.PRECIO',
TBILLYIELD: 'LETRA.DE.TES.RENDTO',
TEXT: 'TEXTO',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'UNIRCADENAS',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'NSHORA',
TIMEVALUE: 'HORANUMERO',
TODAY: 'HOY',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/fiFI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'OBLIG.HINTA',
TBILLYIELD: 'OBLIG.TUOTTO',
TEXT: 'TEKSTI',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'TEKSTI.YHDISTÄ',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'AIKA',
TIMEVALUE: 'AIKA_ARVO',
TODAY: 'TÄMÄ.PÄIVÄ',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/frFR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'PRIX.BON.TRESOR',
TBILLYIELD: 'RENDEMENT.BON.TRESOR',
TEXT: 'TEXTE',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'JOINDRE.TEXTE',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'TEMPS',
TIMEVALUE: 'TEMPSVAL',
TODAY: 'AUJOURDHUI',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/huHU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'KJEGY.ÁR',
TBILLYIELD: 'KJEGY.HOZAM',
TEXT: 'SZÖVEG',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'SZÖVEGÖSSZEFŰZÉS',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'IDŐ',
TIMEVALUE: 'IDŐÉRTÉK',
TODAY: 'MA',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/idID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'TBILL.HARGA',
TBILLYIELD: 'TBILL.HASIL',
TEXT: 'TEKS',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'TEXTJOIN',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'WAKTU',
TIMEVALUE: 'NILAI.WAKTU',
TODAY: 'HARI.INI',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/itIT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'BOT.PREZZO',
TBILLYIELD: 'BOT.REND',
TEXT: 'TESTO',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'UNISCI.TESTO',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'ORARIO',
TIMEVALUE: 'ORARIO.VALORE',
TODAY: 'OGGI',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/nbNO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'TBILLPRIS',
TBILLYIELD: 'TBILLAVKASTNING',
TEXT: 'TEKST',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'TEKST.KOMBINER',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'TID',
TIMEVALUE: 'TIDSVERDI',
TODAY: 'IDAG',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/nlNL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'SCHATK.PRIJS',
TBILLYIELD: 'SCHATK.REND',
TEXT: 'TEKST',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'TEKST.KOPPELEN',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'TIJD',
TIMEVALUE: 'TIJDWAARDE',
TODAY: 'VANDAAG',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/plPL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'CENA.BS',
TBILLYIELD: 'RENT.BS',
TEXT: 'TEKST',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'POŁĄCZ.TEKSTY',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'CZAS',
TIMEVALUE: 'CZAS.WARTOŚĆ',
TODAY: 'DZIŚ',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/ptPT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'OTNVALOR',
TBILLYIELD: 'OTNLUCRO',
TEXT: 'TEXTO',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'UNIRTEXTO',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'TEMPO',
TIMEVALUE: 'VALOR.TEMPO',
TODAY: 'HOJE',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/ruRU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'ЦЕНАКЧЕК',
TBILLYIELD: 'ДОХОДКЧЕК',
TEXT: 'ТЕКСТ',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'ОБЪЕДИНИТЬ',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'ВРЕМЯ',
TIMEVALUE: 'ВРЕМЗНАЧ',
TODAY: 'СЕГОДНЯ',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/svSE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'SSVXPRIS',
TBILLYIELD: 'SSVXRÄNTA',
TEXT: 'TEXT',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'TEXTJOIN',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'KLOCKSLAG',
TIMEVALUE: 'TIDVÄRDE',
TODAY: 'IDAG',
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/languages/trTR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ const dictionary: RawTranslationPackage = {
TBILLPRICE: 'HTAHDEĞER',
TBILLYIELD: 'HTAHÖDEME',
TEXT: 'METNEÇEVİR',
TEXTAFTER: 'TEXTAFTER',
TEXTBEFORE: 'TEXTBEFORE',
TEXTJOIN: 'METİNBİRLEŞTİR',
TEXTSPLIT: 'TEXTSPLIT',
TIME: 'ZAMAN',
TIMEVALUE: 'ZAMANSAYISI',
TODAY: 'BUGÜN',
Expand Down
21 changes: 21 additions & 0 deletions src/interpreter/functionMetadata/categories/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,34 @@ export const TEXT_DOCS: Record<string, FunctionDoc> = {
documentationUrl: 'https://hyperformula.handsontable.com/docs/guide/built-in-functions.html',
examples: ['=TEXT(1234.5, "0.00")', '=TEXT(TODAY(), "YYYY-MM-DD")'],
},
TEXTAFTER: {
category: 'Text',
shortDescription: 'Returns the text that occurs after the instance_num-th occurrence of delimiter. A negative instance_num counts occurrences from the end of text. Returns if_not_found, or #N/A when it is omitted, if the delimiter is not found.',
parameters: [{name: 'text', description: 'The text to search.'}, {name: 'delimiter', description: 'The text (or array of texts) that marks the point after which the result starts.'}, {name: 'instance_num', description: 'Which occurrence of delimiter to use, truncated to an integer. A negative value counts from the end of text. Defaults to 1.'}, {name: 'match_mode', description: '0 (default) for case-sensitive matching, 1 for case-insensitive matching.'}, {name: 'match_end', description: '1 to treat the end of text as a delimiter, 0 (default) otherwise.'}, {name: 'if_not_found', description: 'The value returned when delimiter is not found. Defaults to #N/A.'}],
documentationUrl: 'https://hyperformula.handsontable.com/docs/guide/built-in-functions.html',
examples: ['=TEXTAFTER("a-b-c", "-")', '=TEXTAFTER("a-b-c", "-", -1)'],
},
TEXTBEFORE: {
category: 'Text',
shortDescription: 'Returns the text that occurs before the instance_num-th occurrence of delimiter. A negative instance_num counts occurrences from the end of text. Returns if_not_found, or #N/A when it is omitted, if the delimiter is not found.',
parameters: [{name: 'text', description: 'The text to search.'}, {name: 'delimiter', description: 'The text (or array of texts) that marks the point before which the result ends.'}, {name: 'instance_num', description: 'Which occurrence of delimiter to use, truncated to an integer. A negative value counts from the end of text. Defaults to 1.'}, {name: 'match_mode', description: '0 (default) for case-sensitive matching, 1 for case-insensitive matching.'}, {name: 'match_end', description: '1 to treat the end of text as a delimiter, 0 (default) otherwise.'}, {name: 'if_not_found', description: 'The value returned when delimiter is not found. Defaults to #N/A.'}],
documentationUrl: 'https://hyperformula.handsontable.com/docs/guide/built-in-functions.html',
examples: ['=TEXTBEFORE("a-b-c", "-")', '=TEXTBEFORE("a-b-c", "-", 2)'],
},
TEXTJOIN: {
category: 'Text',
shortDescription: 'Joins text from multiple strings and/or ranges with a delimiter. Supports array/range delimiters that cycle through gaps. When ignore_empty is TRUE, empty strings are skipped. Returns #VALUE! if result exceeds 32,767 characters.',
parameters: [{name: 'delimiter', description: 'The text (or range/array of texts, cycled through the gaps) inserted between joined values.'}, {name: 'ignore_empty', description: 'When TRUE, empty strings among the joined values are skipped instead of producing an extra delimiter.'}, {name: 'text1', description: 'A text value, cell reference, or range to join. Further text values or ranges can be passed as additional arguments and are appended in order.'}],
documentationUrl: 'https://hyperformula.handsontable.com/docs/guide/built-in-functions.html',
examples: ['=TEXTJOIN(", ", TRUE(), A1:A3)', '=TEXTJOIN("-", FALSE(), "a", "b", "c")'],
},
TEXTSPLIT: {
category: 'Text',
shortDescription: 'Splits text into an array: col_delimiter separates columns and row_delimiter separates rows. Rows shorter than the widest one are padded with pad_with. The result spills only when its arguments are literals.',
parameters: [{name: 'text', description: 'The text to split.'}, {name: 'col_delimiter', description: 'The text (or array of texts) that separates columns. Leave empty to split into rows only.'}, {name: 'row_delimiter', description: 'The text (or array of texts) that separates rows. When omitted, the result has a single row.'}, {name: 'ignore_empty', description: 'When TRUE, empty pieces are skipped. Defaults to FALSE.'}, {name: 'match_mode', description: '0 (default) for case-sensitive matching, 1 for case-insensitive matching.'}, {name: 'pad_with', description: 'The value that fills the missing cells of short rows. Defaults to #N/A.'}],
documentationUrl: 'https://hyperformula.handsontable.com/docs/guide/built-in-functions.html',
examples: ['=TEXTSPLIT("a,b,c", ",")', '=TEXTSPLIT("a,b;c,d", ",", ";")'],
},
TRIM: {
category: 'Text',
shortDescription: 'Strips extra spaces from text.',
Expand Down
Loading
Loading