From 8a00791d2419e6d4534b58ccd14c65a202574c0a Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:08:25 +0530 Subject: [PATCH] docs: example corrections Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../060.formula/020.numeric-functions.md | 18 ++++---- .../060.formula/030.string-functions.md | 42 +++++++++---------- .../060.formula/040.date-functions.md | 12 +++--- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/packages/noco-docs/docs/070.fields/040.field-types/060.formula/020.numeric-functions.md b/packages/noco-docs/docs/070.fields/040.field-types/060.formula/020.numeric-functions.md index 3debfe493a..249cf3200a 100644 --- a/packages/noco-docs/docs/070.fields/040.field-types/060.formula/020.numeric-functions.md +++ b/packages/noco-docs/docs/070.fields/040.field-types/060.formula/020.numeric-functions.md @@ -121,7 +121,7 @@ COUNTALL("one", "two", "three") => 3 ------------ ## EVEN -The EVEN function rounds a number up to the nearest even integer. +The EVEN function rounds positive values up to the nearest even number and negative values down to the nearest even number. #### Syntax ```plaintext @@ -146,8 +146,8 @@ EXP(number) #### Sample ```plaintext -EXP(2) => 7.389 -EXP(-1) => 0.368 +EXP(2) => 7.38905609893065 +EXP(-1) => 0.36787944117144233 ``` ------------ @@ -249,7 +249,7 @@ MOD(-15, 4) => -3 ------------ ## ODD -The ODD function rounds a number up to the nearest odd integer greater than or equal to the specified value. +The ODD function rounds positive values up to the nearest odd number and negative values down to the nearest odd number. #### Syntax ```plaintext @@ -258,8 +258,8 @@ ODD(number) #### Sample ```plaintext -ODD(7) => 7 -ODD(-5) => -5 +ODD(6) => 7 +ODD(-5.5) => -7 ``` ------------ @@ -339,7 +339,7 @@ SQRT(number) #### Sample ```plaintext SQRT(25) => 5 -SQRT(2) => 1.414 +SQRT(2) => 1.4142135623730951 ``` ------------ @@ -354,8 +354,8 @@ VALUE(text) #### Sample ```plaintext -VALUE("123") => 123 -VALUE("-45.67") => -45.67 +VALUE("123$") => 123 +VALUE("USD -45.67") => -45.67 ``` ------------ diff --git a/packages/noco-docs/docs/070.fields/040.field-types/060.formula/030.string-functions.md b/packages/noco-docs/docs/070.fields/040.field-types/060.formula/030.string-functions.md index fe018fe703..445cc86516 100644 --- a/packages/noco-docs/docs/070.fields/040.field-types/060.formula/030.string-functions.md +++ b/packages/noco-docs/docs/070.fields/040.field-types/060.formula/030.string-functions.md @@ -12,7 +12,7 @@ The CONCAT function concatenates one or more strings into a single string. #### Syntax ```plaintext -CONCAT(str1, [str2,...]) +CONCAT(text, [text,...]) ``` #### Sample @@ -21,11 +21,11 @@ CONCAT('John', ' ', 'Doe') => 'John Doe' ``` ## LEFT -The LEFT function retrieves the first 'n' characters from the beginning of the input string. +The LEFT function retrieves the first 'n' characters specified from the beginning of the input string. #### Syntax ```plaintext -LEFT(str1, n) +LEFT(text, count) ``` #### Sample @@ -38,12 +38,12 @@ The LEN function calculates and returns the total number of characters present i #### Syntax ```plaintext -LEN(str) +LEN(text) ``` #### Sample ```plaintext -LEN('Product Description') => 18 +LEN('Product Description') => 19 ``` ## LOWER @@ -51,7 +51,7 @@ The LOWER function transforms all characters in the input string to lowercase #### Syntax ```plaintext -LOWER(str) +LOWER(text) ``` #### Sample @@ -64,7 +64,7 @@ The MID function retrieves a substring from the input string starting at the spe #### Syntax ```plaintext -MID(str, position, [count]) +MID(text, position, [count]) ``` #### Sample @@ -77,7 +77,7 @@ The REGEX_EXTRACT function searches the input string for the first occurrence of #### Syntax ```plaintext -REGEX_EXTRACT(str, pattern) +REGEX_EXTRACT(text, pattern) ``` #### Sample @@ -90,7 +90,7 @@ The REGEX_MATCH function evaluates whether the input string matches the specifie #### Syntax ```plaintext -REGEX_MATCH(str, pattern) +REGEX_MATCH(text, pattern) ``` #### Sample @@ -103,7 +103,7 @@ The REGEX_REPLACE function identifies all occurrences of the specified regular e #### Syntax ```plaintext -REGEX_REPLACE(str, pattern, replacer) +REGEX_REPLACE(text, pattern, replacer) ``` @@ -117,7 +117,7 @@ The REPEAT function duplicates the provided string the specified number of times #### Syntax ```plaintext -REPEAT(str, count) +REPEAT(text, count) ``` #### Sample @@ -130,7 +130,7 @@ The REPLACE function identifies all instances of a particular substring within t #### Syntax ```plaintext -REPLACE(str, srchStr, rplcStr) +REPLACE(text, srchStr, rplcStr) ``` #### Sample @@ -143,7 +143,7 @@ The RIGHT function retrieves the last 'n' characters from the end of the input s #### Syntax ```plaintext -RIGHT(str, n) +RIGHT(text, n) ``` #### Sample @@ -156,12 +156,12 @@ The SEARCH function identifies the position of the specified substring within th #### Syntax ```plaintext -SEARCH(str, srchStr) +SEARCH(text, srchStr) ``` #### Sample ```plaintext -SEARCH('user@example.com', '@') => 4 +SEARCH('user@example.com', '@') => 5 ``` ## SUBSTR @@ -169,12 +169,12 @@ The SUBSTR function extracts a substring from the input string, starting at the #### Syntax ```plaintext -SUBSTR(str, position, [count]) +SUBSTR(text, position, [count]) ``` #### Sample ```plaintext -SUBSTR('Extract this text', 8, 4) => 'this' +SUBSTR('Extract this text', 9, 4) => 'this' ``` ## TRIM @@ -182,7 +182,7 @@ The TRIM function eliminates any leading or trailing whitespaces from the input #### Syntax ```plaintext -TRIM(str) +TRIM(text) ``` #### Sample @@ -195,7 +195,7 @@ The UPPER function transforms all characters in the input string to uppercase. #### Syntax ```plaintext -UPPER(str) +UPPER(text) ``` #### Sample @@ -208,12 +208,12 @@ The URL function checks if the input string is a valid URL and converts it into #### Syntax ```plaintext -URL(str) +URL(text) ``` #### Sample ```plaintext -URL('https://www.example.com') => 'https://www.example.com' +URL('https://www.example.com') => a clickable link for https://www.example.com ``` diff --git a/packages/noco-docs/docs/070.fields/040.field-types/060.formula/040.date-functions.md b/packages/noco-docs/docs/070.fields/040.field-types/060.formula/040.date-functions.md index 2d3c9e1215..9385ad06e1 100644 --- a/packages/noco-docs/docs/070.fields/040.field-types/060.formula/040.date-functions.md +++ b/packages/noco-docs/docs/070.fields/040.field-types/060.formula/040.date-functions.md @@ -18,11 +18,11 @@ DATETIME_DIFF(date1, date2, ["milliseconds" | "ms" | "seconds" | "s" | "minutes" #### Sample ```plaintext -DATETIME_DIFF("2022/10/14", "2022/10/15", "second") => 86400 +DATETIME_DIFF("2022/10/14", "2022/10/15", "seconds") => -86400 ``` #### Remark -This function compares two dates and returns the difference in the specified unit. Positive integers indicate that date1 is in the past compared to date2, and vice versa for negative values. +This function compares two dates and returns the difference in the specified unit. Positive integers indicate that second date is in the past compared to first, and vice versa for negative values. --- @@ -36,10 +36,10 @@ DATEADD(date | datetime, value, ["day" | "week" | "month" | "year"]) #### Sample ```plaintext -DATEADD(2022-03-14, 1, 'day') => 2022-03-15 -DATEADD(2022-03-14, 1, 'week') => 2022-03-21 -DATEADD(2022-03-14, 1, 'month') => 2022-04-14 -DATEADD(2022-03-14, 1, 'year') => 2023-03-14 +DATEADD('2022-03-14', 1, 'day') => 2022-03-15 +DATEADD('2022-03-14', 1, 'week') => 2022-03-21 +DATEADD('2022-03-14', 1, 'month') => 2022-04-14 +DATEADD('2022-03-14', 1, 'year') => 2023-03-14 ``` #### Conditional Example