Skip to content
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Added 9 text functions EXACT, LOWER, UPPER, MID, T, SUBSTITUTE, REPLACE, UNICODE, UNICHAR. (#159)

## [0.2.0] - 2020-09-22

### Added
Expand Down
22 changes: 16 additions & 6 deletions docs/guide/built-in-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,26 @@ lets you design your own [custom functions](custom-functions).
| MIN | Statistical | Returns the minimum value in a list of arguments. | MIN(Number1; Number2; ...Number30) |
| MINA | Statistical | Returns the minimum value in a list of arguments. | MINA(Value1; Value2; ... Value30) |
| CHAR | Text | Converts a number into a character according to the current code table. | CHAR(Number) |
| CLEAN <br><Badge text="v0.2.0"/>| Text | Returns text that has been "cleaned" of line breaks and other non-printable characters. | CLEAN("Text") |
| CLEAN | Text | Returns text that has been "cleaned" of line breaks and other non-printable characters. | CLEAN("Text") |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| CLEAN | Text | Returns text that has been "cleaned" of line breaks and other non-printable characters. | CLEAN("Text") |
| CLEAN | Text | Returns text that has been "cleaned" of line breaks and other non-printable characters. | CLEAN(Text) |

| CODE | Text | Returns a numeric code for the first character in a text string. | CODE("Text") |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| CODE | Text | Returns a numeric code for the first character in a text string. | CODE("Text") |
| CODE | Text | Returns a numeric code for the first character in a text string. | CODE(Text) |

| CONCATENATE | Text | Combines several text strings into one string. | CONCATENATE("Text1"; ...; "Text30") |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| CONCATENATE | Text | Combines several text strings into one string. | CONCATENATE("Text1"; ...; "Text30") |
| CONCATENATE | Text | Combines several text strings into one string. | CONCATENATE(Text1; ...; Text30) |

| SPLIT | Text | Divides text around a specified character or string, and puts each fragment into a separate cell in the row. | SPLIT(Text, Delimiter, [Split_by_each], [Remove_empty_text]) |
| TEXT | Text | Converts a number into text according to a given format. | TEXT(Number; Format) |
| EXACT | Text | Returns TRUE if both text strings are exactly the same. | EXACT(Text; Text) |
| FIND <br><Badge text="v0.2.0"/>| Text | Returns the location of one text string inside another. | FIND( "Text1"; "Text2"[; Number]) |
| LEFT <br><Badge text="v0.2.0"/>| Text | Extracts a given number of characters from the left side of a text string. | LEFT("Text"; Number) |
| LEN <br><Badge text="v0.2.0"/>| Text | Returns length of a given text. | LEN("Text") |
| TRIM <br><Badge text="v0.2.0"/>| Text | Strips extra spaces from text. | TRIM("Text") |
| LOWER | Text | Returns text converted to lowercase. | LOWER(Text) |
| MID | Text | Returns substring of a given length starting from Start_position. | MID(Text, Start_position, Length) |
| PROPER <br><Badge text="v0.2.0"/>| Text | Capitalizes words given text string. | PROPER("Text") |
| CLEAN <br><Badge text="v0.2.0"/>| Text | Returns text that has been "cleaned" of line breaks and other non-printable characters. | CLEAN("Text") |
| REPLACE | Text | Replaces substring of a text of a given length that starts at given position. | REPLACE(Text; Start_position; Length; New_text) |
| REPT <br><Badge text="v0.2.0"/>| Text | Repeats text a given number of times. | REPT("Text"; Number) |
| RIGHT <br><Badge text="v0.2.0"/>| Text | Extracts a given number of characters from the right side of a text string. | RIGHT("Text"; Number) |
| LEFT <br><Badge text="v0.2.0"/>| Text | Extracts a given number of characters from the left side of a text string. | LEFT("Text"; Number) |
| SEARCH <br><Badge text="v0.2.0"/>| Text | Returns the location of one text string inside another. (Allows the use of wildcards.) | SEARCH( "Text1"; "Text2"[; Number]) |
| FIND <br><Badge text="v0.2.0"/>| Text | Returns the location of one text string inside another. | FIND( "Text1"; "Text2"[; Number]) |
| SPLIT | Text | Divides text around a specified character or string, and puts each fragment into a separate cell in the row. | SPLIT(Text, Delimiter, [Split_by_each], [Remove_empty_text]) |
| SUBSTITUTE | Text | Returns string where occurrences of Old_text are replaced by New_text. Replaces only specific occurrence if last parameter is provided. | SUBSTITUTE(Text; Old_text; New_text; [Occurrence]) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| SUBSTITUTE | Text | Returns string where occurrences of Old_text are replaced by New_text. Replaces only specific occurrence if last parameter is provided. | SUBSTITUTE(Text; Old_text; New_text; [Occurrence]) |
| SUBSTITUTE | Text | Returns string where occurrences of Old_text are replaced by New_text. Replaces only specific occurrence if last parameter is provided. | SUBSTITUTE(Text; Old_text; New_text[; Occurrence]) |

| T | Text | Returns text if given value is text, empty string otherwise. | T(Value) |
| TEXT | Text | Converts a number into text according to a given format. | TEXT(Number; Format) |
| TRIM <br><Badge text="v0.2.0"/>| Text | Strips extra spaces from text. | TRIM("Text") |
| UNICHAR | Text | Returns the character created by using provided code point. | UNICHAR(Number) |
| UNICODE | Text | Returns the Unicode code point of a first character of a text. | UNICODE(Text) |
| UPPER | Text | Returns text converted to uppercase. | UPPER(Text) |
1 change: 1 addition & 0 deletions src/error-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class ErrorMessage {
public static IncorrectDateTime = 'String does not represent correct DateTime.'
public static CharacterCodeBounds = 'Character code out of bounds.'
public static NonZero = 'Argument cannot be 0.'
public static LessThanOne = 'Argument cannot be less than 1.'
public static FunctionName = (arg: string) => `Function name ${arg} not recognized.`
public static NamedExpressionName = (arg: string) => `Named expression ${arg} not recognized.`
public static LicenseKey = (arg: string) => `License key is ${arg}.`
Expand Down
9 changes: 9 additions & 0 deletions src/i18n/languages/csCZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const dictionary: RawTranslationPackage = {
ERF: 'ERF',
ERFC: 'ERFC',
EVEN: 'ZAOKROUHLIT.NA.SUDÉ',
EXACT: 'STEJNÉ',
EXP: 'EXP',
FALSE: 'NEPRAVDA',
FIND: 'NAJÍT',
Expand Down Expand Up @@ -120,12 +121,14 @@ const dictionary: RawTranslationPackage = {
LN: 'LN',
LOG10: 'LOG',
LOG: 'LOGZ',
LOWER: 'MALÁ',
MATCH: 'POZVYHLEDAT',
MAX: 'MAX',
MAXA: 'MAXA',
MAXPOOL: 'MAXPOOL',
MEDIAN: 'MEDIAN',
MEDIANPOOL: 'MEDIANPOOL',
MID: 'ČÁST',
MIN: 'MIN',
MINA: 'MINA',
MINUTE: 'MINUTA',
Expand All @@ -145,6 +148,7 @@ const dictionary: RawTranslationPackage = {
OR: 'NEBO',
PI: 'PI',
PMT: 'PLATBA',
SUBSTITUTE: 'DOSADIT',
POWER: 'POWER',
PPMT: 'PLATBA.ZÁKLAD',
PROPER: 'VELKÁ2',
Expand Down Expand Up @@ -177,6 +181,7 @@ const dictionary: RawTranslationPackage = {
SUMSQ: 'SUMA.ČTVERCŮ',
SWITCH: '',
SYD: 'ODPIS.NELIN',
T: 'T',
TAN: 'TG',
TANH: 'TGH',
TBILLEQ: 'TBILLEQ',
Expand All @@ -190,12 +195,16 @@ const dictionary: RawTranslationPackage = {
TRIM: 'PROČISTIT',
TRUE: 'PRAVDA',
TRUNC: 'USEKNOUT',
UNICHAR: 'UNICHAR',
UNICODE: 'UNICODE',
UPPER: 'VELKÁ',
VLOOKUP: 'SVYHLEDAT',
WEEKDAY: 'DENTÝDNE',
WEEKNUM: 'WEEKNUM',
XOR: 'XOR',
YEAR: 'ROK',
YEARFRAC: 'YEARFRAC',
REPLACE: 'NAHRADIT',
},
langCode: 'csCZ',
ui: {
Expand Down
9 changes: 9 additions & 0 deletions src/i18n/languages/daDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const dictionary: RawTranslationPackage = {
ERF: 'FEJLFUNK',
ERFC: 'FEJLFUNK.KOMP',
EVEN: 'LIGE',
EXACT: 'EKSAKT',
EXP: 'EKSP',
FALSE: 'FALSE',
FIND: 'FIND',
Expand Down Expand Up @@ -120,12 +121,14 @@ const dictionary: RawTranslationPackage = {
LN: 'LN',
LOG10: 'LOG10',
LOG: 'LOG',
LOWER: 'SMÅ.BOGSTAVER',
MATCH: 'SAMMENLIGN',
MAX: 'MAKS',
MAXA: 'MAKSV',
MAXPOOL: 'MAXPOOL',
MEDIAN: 'MEDIAN',
MEDIANPOOL: 'MEDIANPOOL',
MID: 'MIDT',
MIN: 'MIN',
MINA: 'MINV',
MINUTE: 'MINUT',
Expand All @@ -145,6 +148,7 @@ const dictionary: RawTranslationPackage = {
OR: 'ELLER',
PI: 'PI',
PMT: 'YDELSE',
SUBSTITUTE: 'UDSKIFT',
POWER: 'POTENS',
PPMT: 'H.YDELSE',
PROPER: 'STORT.FORBOGSTAV',
Expand Down Expand Up @@ -177,6 +181,7 @@ const dictionary: RawTranslationPackage = {
SUMSQ: 'SUMKV',
SWITCH: '',
SYD: 'ÅRSAFSKRIVNING',
T: 'T',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'STATSOBLIGATION',
Expand All @@ -190,12 +195,16 @@ const dictionary: RawTranslationPackage = {
TRIM: 'FJERN.OVERFLØDIGE.BLANKE',
TRUE: 'TRUE',
TRUNC: 'AFKORT',
UNICHAR: 'UNICHAR',
UNICODE: 'UNICODE',
UPPER: 'STORE.BOGSTAVER',
VLOOKUP: 'LOPSLAG',
WEEKDAY: 'UGEDAG',
WEEKNUM: 'UGE.NR',
XOR: 'XELLER',
YEAR: 'ÅR',
YEARFRAC: 'ÅR.BRØK',
REPLACE: 'ERSTAT',
},
langCode: 'daDK',
ui: {
Expand Down
9 changes: 9 additions & 0 deletions src/i18n/languages/deDE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const dictionary: RawTranslationPackage = {
ERF: 'GAUSSFEHLER',
ERFC: 'GAUSSFKOMPL',
EVEN: 'GERADE',
EXACT: 'IDENTISCH',
EXP: 'EXP',
FALSE: 'FALSCH',
FIND: 'FINDEN',
Expand Down Expand Up @@ -120,12 +121,14 @@ const dictionary: RawTranslationPackage = {
LN: 'LN',
LOG10: 'LOG10',
LOG: 'LOG',
LOWER: 'KLEIN',
MATCH: 'VERGLEICH',
MAX: 'MAX',
MAXA: 'MAXA',
MAXPOOL: 'MAXPOOL',
MEDIAN: 'MEDIAN',
MEDIANPOOL: 'MEDIANPOOL',
MID: 'TEIL',
MIN: 'MIN',
MINA: 'MINA',
MINUTE: 'MINUTE',
Expand All @@ -145,6 +148,7 @@ const dictionary: RawTranslationPackage = {
OR: 'ODER',
PI: 'PI',
PMT: 'RMZ',
SUBSTITUTE: 'WECHSELN',
POWER: 'POTENZ',
PPMT: 'KAPZ',
PROPER: 'GROSS2',
Expand Down Expand Up @@ -177,6 +181,7 @@ const dictionary: RawTranslationPackage = {
SUMSQ: 'QUADRATESUMME',
SWITCH: '',
SYD: 'DIA',
T: 'T',
TAN: 'TAN',
TANH: 'TANHYP',
TBILLEQ: 'TBILLÄQUIV',
Expand All @@ -190,12 +195,16 @@ const dictionary: RawTranslationPackage = {
TRIM: 'GLÄTTEN',
TRUE: 'WAHR',
TRUNC: 'KÜRZEN',
UNICHAR: 'UNIZEICHEN',
UNICODE: 'UNICODE',
UPPER: 'GROSS',
VLOOKUP: 'SVERWEIS',
WEEKDAY: 'WOCHENTAG',
WEEKNUM: 'KALENDERWOCHE',
XOR: 'XODER',
YEAR: 'JAHR',
YEARFRAC: 'BRTEILJAHRE',
REPLACE: 'ERSETZEN',
},
langCode: 'deDE',
ui: {
Expand Down
9 changes: 9 additions & 0 deletions src/i18n/languages/enGB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const dictionary: RawTranslationPackage = {
ERF: 'ERF',
ERFC: 'ERFC',
EVEN: 'EVEN',
EXACT: 'EXACT',
EXP: 'EXP',
FALSE: 'FALSE',
FIND: 'FIND',
Expand Down Expand Up @@ -120,12 +121,14 @@ const dictionary: RawTranslationPackage = {
LN: 'LN',
LOG10: 'LOG10',
LOG: 'LOG',
LOWER: 'LOWER',
MATCH: 'MATCH',
MAX: 'MAX',
MAXA: 'MAXA',
MAXPOOL: 'MAXPOOL',
MEDIAN: 'MEDIAN',
MEDIANPOOL: 'MEDIANPOOL',
MID: 'MID',
MIN: 'MIN',
MINA: 'MINA',
MINUTE: 'MINUTE',
Expand All @@ -145,6 +148,7 @@ const dictionary: RawTranslationPackage = {
OR: 'OR',
PI: 'PI',
PMT: 'PMT',
SUBSTITUTE: 'SUBSTITUTE',
POWER: 'POWER',
PPMT: 'PPMT',
PROPER: 'PROPER',
Expand Down Expand Up @@ -177,6 +181,7 @@ const dictionary: RawTranslationPackage = {
SUMSQ: 'SUMSQ',
SWITCH: 'SWITCH',
SYD: 'SYD',
T: 'T',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'TBILLEQ',
Expand All @@ -190,12 +195,16 @@ const dictionary: RawTranslationPackage = {
TRIM: 'TRIM',
TRUE: 'TRUE',
TRUNC: 'TRUNC',
UNICHAR: 'UNICHAR',
UNICODE: 'UNICODE',
UPPER: 'UPPER',
VLOOKUP: 'VLOOKUP',
WEEKDAY: 'WEEKDAY',
WEEKNUM: 'WEEKNUM',
XOR: 'XOR',
YEAR: 'YEAR',
YEARFRAC: 'YEARFRAC',
REPLACE: 'REPLACE',
},
langCode: 'enGB',
ui: {
Expand Down
9 changes: 9 additions & 0 deletions src/i18n/languages/esES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const dictionary: RawTranslationPackage = {
ERF: 'FUN.ERROR',
ERFC: 'FUN.ERROR.COMPL',
EVEN: 'REDONDEA.PAR',
EXACT: 'IGUAL',
EXP: 'EXP',
FALSE: 'FALSO',
FIND: 'ENCONTRAR',
Expand Down Expand Up @@ -120,12 +121,14 @@ export const dictionary: RawTranslationPackage = {
LN: 'LN',
LOG10: 'LOG10',
LOG: 'LOG',
LOWER: 'MINUSC',
MATCH: 'COINCIDIR',
MAX: 'MAX',
MAXA: 'MAXA',
MAXPOOL: 'MAXPOOL',
MEDIAN: 'MEDIANA',
MEDIANPOOL: 'MEDIANPOOL',
MID: 'EXTRAE',
MIN: 'MIN',
MINA: 'MINA',
MINUTE: 'MINUTO',
Expand All @@ -145,6 +148,7 @@ export const dictionary: RawTranslationPackage = {
OR: 'O',
PI: 'PI',
PMT: 'PAGO',
SUBSTITUTE: 'SUSTITUIR',
POWER: 'POTENCIA',
PPMT: 'PAGOPRIN',
PROPER: 'NOMPROPIO',
Expand Down Expand Up @@ -177,6 +181,7 @@ export const dictionary: RawTranslationPackage = {
SUMSQ: 'SUMA.CUADRADOS',
SWITCH: '',
SYD: 'SYD',
T: 'T',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'LETRA.DE.TEST.EQV.A.BONO',
Expand All @@ -190,12 +195,16 @@ export const dictionary: RawTranslationPackage = {
TRIM: 'ESPACIOS',
TRUE: 'VERDADERO',
TRUNC: 'TRUNCAR',
UNICHAR: 'UNICHAR',
UNICODE: 'UNICODE',
UPPER: 'MAYUSC',
VLOOKUP: 'BUSCARV',
WEEKDAY: 'DIASEM',
WEEKNUM: 'NUM.DE.SEMANA',
XOR: 'XOR',
YEAR: 'AÑO',
YEARFRAC: 'FRAC.AÑO',
REPLACE: 'REEMPLAZAR',
},
langCode: 'esES',
ui: {
Expand Down
9 changes: 9 additions & 0 deletions src/i18n/languages/fiFI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const dictionary: RawTranslationPackage = {
ERF: 'VIRHEFUNKTIO',
ERFC: 'VIRHEFUNKTIO.KOMPLEMENTTI',
EVEN: 'PARILLINEN',
EXACT: 'VERTAA',
EXP: 'EKSPONENTTI',
FALSE: 'EPÄTOSI',
FIND: 'ETSI',
Expand Down Expand Up @@ -120,12 +121,14 @@ const dictionary: RawTranslationPackage = {
LN: 'LUONNLOG',
LOG10: 'LOG10',
LOG: 'LOG',
LOWER: 'PIENET',
MATCH: 'VASTINE',
MAX: 'MAKS',
MAXA: 'MAKSA',
MAXPOOL: 'MAXPOOL',
MEDIAN: 'MEDIAANI',
MEDIANPOOL: 'MEDIANPOOL',
MID: 'POIMI.TEKSTI',
MIN: 'MIN',
MINA: 'MINA',
MINUTE: 'MINUUTIT',
Expand All @@ -145,6 +148,7 @@ const dictionary: RawTranslationPackage = {
OR: 'TAI',
PI: 'PII',
PMT: 'MAKSU',
SUBSTITUTE: 'VAIHDA',
POWER: 'POTENSSI',
PPMT: 'PPMT',
PROPER: 'ERISNIMI',
Expand Down Expand Up @@ -177,6 +181,7 @@ const dictionary: RawTranslationPackage = {
SUMSQ: 'NELIÖSUMMA',
SWITCH: '',
SYD: 'VUOSIPOISTO',
T: 'T',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'OBLIG.TUOTTOPROS',
Expand All @@ -190,12 +195,16 @@ const dictionary: RawTranslationPackage = {
TRIM: 'POISTA.VÄLIT',
TRUE: 'TOSI',
TRUNC: 'KATKAISE',
UNICHAR: 'UNICODEMERKKI',
UNICODE: 'UNICODE',
UPPER: 'ISOT',
VLOOKUP: 'PHAKU',
WEEKDAY: 'VIIKONPÄIVÄ',
WEEKNUM: 'VIIKKO.NRO',
XOR: 'EHDOTON.TAI',
YEAR: 'VUOSI',
YEARFRAC: 'VUOSI.OSA',
REPLACE: 'KORVAA',
},
langCode: 'fiFI',
ui: {
Expand Down
Loading