Skip to content

Commit b87d281

Browse files
sequbabudnix
andauthored
Implement VALUE function (#1605)
* Tests for function VALUE * Function VALUE implementation * Refactor --------- Co-authored-by: Krzysztof ‘Budzio’ Budnik <571316+budnix@users.noreply.github.com>
1 parent a1fb600 commit b87d281

22 files changed

Lines changed: 540 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1111

1212
- Added a new function: IRR. [#1591](https://github.com/handsontable/hyperformula/issues/1591)
1313
- Added a new function: N. [#1585](https://github.com/handsontable/hyperformula/issues/1585)
14+
- Added a new function: VALUE. [#1592](https://github.com/handsontable/hyperformula/issues/1592)
1415

1516
## [3.1.1] - 2025-12-18
1617

docs/guide/built-in-functions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ Total number of functions: **{{ $page.functionsCount }}**
506506
| UNICHAR | Returns the character created by using provided code point. | UNICHAR(Number) |
507507
| UNICODE | Returns the Unicode code point of a first character of a text. | UNICODE(Text) |
508508
| UPPER | Returns text converted to uppercase. | UPPER(Text) |
509+
| VALUE | Parses a number, date, time, datetime, currency, or percentage from a text string. | VALUE(Text) |
509510

510511
[^non-odff]:
511512
The return value of this function is compliant with the

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"test": "npm-run-all lint test:unit test:browser test:compatibility",
7979
"test:unit": "cross-env NODE_ICU_DATA=node_modules/full-icu jest",
8080
"test:watch": "cross-env NODE_ICU_DATA=node_modules/full-icu jest --watch",
81-
"test:tdd": "cross-env NODE_ICU_DATA=node_modules/full-icu jest --watch adding-sheet",
81+
"test:tdd": "cross-env NODE_ICU_DATA=node_modules/full-icu jest --watch function-value",
8282
"test:coverage": "npm run test:unit -- --coverage",
8383
"test:logMemory": "cross-env NODE_ICU_DATA=node_modules/full-icu jest --runInBand --logHeapUsage",
8484
"test:unit.ci": "cross-env NODE_ICU_DATA=node_modules/full-icu node --expose-gc ./node_modules/jest/bin/jest --forceExit",

src/NumberLiteralHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class NumberLiteralHelper {
1616
const thousandSeparator = this.config.thousandSeparator === '.' ? `\\${this.config.thousandSeparator}` : this.config.thousandSeparator
1717
const decimalSeparator = this.config.decimalSeparator === '.' ? `\\${this.config.decimalSeparator}` : this.config.decimalSeparator
1818

19-
this.numberPattern = new RegExp(`^([+-]?((${decimalSeparator}\\d+)|(\\d+(${thousandSeparator}\\d{3,})*(${decimalSeparator}\\d*)?)))(e[+-]?\\d+)?$`)
19+
this.numberPattern = new RegExp(`^([+-]?((${decimalSeparator}\\d+)|(\\d+(${thousandSeparator}\\d{3,})*(${decimalSeparator}\\d*)?)))([eE][+-]?\\d+)?$`)
2020
this.allThousandSeparatorsRegex = new RegExp(`${thousandSeparator}`, 'g')
2121
}
2222

src/i18n/languages/csCZ.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
225225
UNICHAR: 'UNICHAR',
226226
UNICODE: 'UNICODE',
227227
UPPER: 'VELKÁ',
228+
VALUE: 'HODNOTA',
228229
VARA: 'VARA',
229230
'VAR.P': 'VAR.P',
230231
VARPA: 'VARPA',

src/i18n/languages/daDK.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
225225
UNICHAR: 'UNICHAR',
226226
UNICODE: 'UNICODE',
227227
UPPER: 'STORE.BOGSTAVER',
228+
VALUE: 'VÆRDI',
228229
VARA: 'VARIANSV',
229230
'VAR.P': 'VARIANS.P',
230231
VARPA: 'VARIANSPV',

src/i18n/languages/deDE.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
225225
UNICHAR: 'UNIZEICHEN',
226226
UNICODE: 'UNICODE',
227227
UPPER: 'GROSS',
228+
VALUE: 'WERT',
228229
VARA: 'VARIANZA',
229230
'VAR.P': 'VAR.P',
230231
VARPA: 'VARIANZENA',

src/i18n/languages/enGB.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ const dictionary: RawTranslationPackage = {
227227
UNICHAR: 'UNICHAR',
228228
UNICODE: 'UNICODE',
229229
UPPER: 'UPPER',
230+
VALUE: 'VALUE',
230231
VARA: 'VARA',
231232
'VAR.P': 'VAR.P',
232233
VARPA: 'VARPA',

src/i18n/languages/esES.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ export const dictionary: RawTranslationPackage = {
225225
UNICHAR: 'UNICHAR',
226226
UNICODE: 'UNICODE',
227227
UPPER: 'MAYUSC',
228+
VALUE: 'VALOR',
228229
VARA: 'VARA',
229230
'VAR.P': 'VAR.P',
230231
VARPA: 'VARPA',

src/i18n/languages/fiFI.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
225225
UNICHAR: 'UNICODEMERKKI',
226226
UNICODE: 'UNICODE',
227227
UPPER: 'ISOT',
228+
VALUE: 'ARVO',
228229
VARA: 'VARA',
229230
'VAR.P': 'VAR.P',
230231
VARPA: 'VARPA',

0 commit comments

Comments
 (0)