Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(formula): add some text formulas #3546

Merged
merged 14 commits into from
Oct 18, 2024
Merged

feat(formula): add some text formulas #3546

merged 14 commits into from
Oct 18, 2024

Conversation

wpxp123456
Copy link
Contributor

close https://github.com/dream-num/univer-pro/issues/2544

Pull Request Checklist

  • Related tickets or issues have been linked in the PR description (or missing issue).
  • Naming convention is followed (do please check it especially when you created new plugins, commands and resources).
  • Unit tests have been added for the changes (if applicable).
  • Breaking changes have been documented (or no breaking changes introduced in this PR).

@wpxp123456 wpxp123456 added the qa:untested This PR is ready to be tested label Sep 24, 2024
Copy link

github-actions bot commented Sep 24, 2024

View Deployment

📑 Examples 📚 Storybook
🔗 Preview link 🔗 Preview link

Copy link

github-actions bot commented Sep 24, 2024

Playwright test results

passed  16 passed
flaky  1 flaky

Details

stats  17 tests across 8 suites
duration  4 minutes, 20 seconds
commit  256522c
info  For more information, see full report

Flaky tests

chromium › visual-comparison/sheets/sheets-visual-comparison.spec.ts › diff default sheet toolbar

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 98.55521% with 14 lines in your changes missing coverage. Please review.

Project coverage is 31.49%. Comparing base (0d313f2) to head (256522c).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
...ngine-formula/src/engine/ast-node/function-node.ts 25.00% 3 Missing ⚠️
...ages/engine-formula/src/engine/utils/numfmt-kit.ts 91.66% 3 Missing ⚠️
...ages/engine-formula/src/functions/base-function.ts 60.00% 2 Missing ⚠️
...ngine-formula/src/services/current-data.service.ts 60.00% 2 Missing ⚠️
.../engine-formula/src/functions/math/arabic/index.ts 97.43% 1 Missing ⚠️
...ne-formula/src/functions/text/arraytotext/index.ts 98.24% 1 Missing ⚠️
...engine-formula/src/functions/text/unichar/index.ts 96.00% 1 Missing ⚠️
...ges/engine-formula/src/services/runtime.service.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3546      +/-   ##
==========================================
+ Coverage   30.97%   31.49%   +0.51%     
==========================================
  Files        2285     2307      +22     
  Lines      118732   119637     +905     
  Branches    26171    26467     +296     
==========================================
+ Hits        36782    37677     +895     
- Misses      81950    81960      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oumomomo
Copy link

oumomomo commented Sep 24, 2024

ACS函数
单元格内输入=ASC("!@#¥%^&*()_-+=") ,¥展示为了口
image

@univer-bot
Copy link

univer-bot bot commented Sep 24, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

ACS function
Enter =ASC("!@#¥%^&*()_-+=") in the cell, ¥ is displayed for oral purpose
image

@oumomomo
Copy link

oumomomo commented Sep 25, 2024

ARRAYTOTEXT
1、单元格内输入带数字格式的内容,返回的内容未展示格式
样张:https://1drv.ms/x/c/c874bd32de218f8c/EVMw4X_YPVpNqMxg54K-Bb8BOOt01RDZWi7a5AREF7Oa3g?e=XDXI6N
image

2、单元格内输入=ARRAYTOTEXT(A1:T1000),计算结果不一致待确定是否符合预期
image

@univer-bot
Copy link

univer-bot bot commented Sep 25, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

ARRAYTOTEXT

  1. Enter content with digital format in the cell, and the returned content does not display the format.
    Sample: https://1drv.ms/x/c/c874bd32de218f8c/EVMw4X_YPVpNqMxg54K-Bb8BOOt01RDZWi7a5AREF7Oa3g?e=XDXI6N
    image

  2. Enter =ARRAYTOTEXT(A1:T1000) in the cell. The calculation results are inconsistent and need to be determined whether they meet expectations.
    image

@oumomomo
Copy link

oumomomo commented Sep 25, 2024

CHAR函数

1、单元格内输入=CHAR(28),页面白屏
image

2、(偶现)从excel复制=CHAR(28)粘贴到单元格失败,控制台报错
企业微信截图_1727245261511

3、单元格内输入=CHAR(41698),无法计算出值
image

@univer-bot
Copy link

univer-bot bot commented Sep 25, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

CHAR function

  1. Enter =CHAR(28) in the cell, and the page will be white.
    image

  2. (Occasionally) Copying =CHAR(28) from excel and pasting it into the cell fails, and the console reports an error
    Enterprise WeChat screenshot_1727245261511

  3. Enter =CHAR(41698) in the cell, but the value cannot be calculated.
    image

@wpxp123456 wpxp123456 requested a review from wzhudev as a code owner October 10, 2024 02:40
@wpxp123456 wpxp123456 force-pushed the feat/add-text-func branch 2 times, most recently from b92fbd3 to 2a32311 Compare October 10, 2024 11:34
@oumomomo
Copy link

oumomomo commented Oct 16, 2024

CLEAN函数

1、单元格内输入=CLEAN(A2),A2引用D1:D6,计算不出结果
image
image

2、=CLEAN(A1:A3),A1:A3单元格为空,预期计算结果为空
image

@univer-bot
Copy link

univer-bot bot commented Oct 16, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

CLEAN function

  1. Enter =CLEAN(A2) in the cell, A2 references D1:D6, and the result cannot be calculated.
    image
    image

  2. =CLEAN(A1:A3), cells A1:A3 are empty, and the expected calculation result is empty.
    image

@oumomomo
Copy link

oumomomo commented Oct 16, 2024

CODE函数
1、单元格内输入=CODE("啊")/=CODE("!"),计算结果跟google一致,待确定预期
image

2、单元格内输入=CODE(""),预期报错
image

@univer-bot
Copy link

univer-bot bot commented Oct 16, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

CODE function

  1. Enter =CODE("Ah")/=CODE("!") in the cell. The calculation results are consistent with Google. The expectations are to be determined.
    image

  2. Enter =CODE("") in the cell, and an error is expected.
    image

@oumomomo
Copy link

oumomomo commented Oct 16, 2024

DBCS函数

1、单元格内输入=DBCS(I87:I88) ,I87:I88单元格为空
image

2、单元格内输入=DBCS(21834),计算结果多了一个符号
image

3、单元格内输入=DBCS(A1 ),A1=0.1258,计算结果被取整
image

@univer-bot
Copy link

univer-bot bot commented Oct 16, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

DBCS function

  1. Enter =DBCS(I87:I88) in the cell, and the cells I87:I88 are empty.
    image

  2. Enter =DBCS(21834) in the cell, and the calculation result will have one more symbol.
    image

  3. Enter =DBCS(A1) in the cell, A1=0.1258, and the calculation result will be rounded.
    image

@oumomomo
Copy link

DOLLAR函数
单元格内输入=DOLLAR(A9),A9=-1234.567,因为我们的数字格式跟excel的格式顺序不一样,所以展示也不一样嘛?
image

@univer-bot
Copy link

univer-bot bot commented Oct 16, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

DOLLAR function
Enter =DOLLAR(A9) in the cell, A9=-1234.567. Because our number format is different from Excel’s format order, the display is also different?
image

@oumomomo
Copy link

NUMBERVALUE函数
单元格输入=NUMBERVALUE(A45 ),A45=20%%,计算不出结果
image

@univer-bot
Copy link

univer-bot bot commented Oct 17, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

NUMBERVALUE function
Cell input =NUMBERVALUE(A45), A45=20%%, no result can be calculated
image

@oumomomo
Copy link

oumomomo commented Oct 17, 2024

RIGHTB函数
1、单元格内输入=RIGHTB/RIGHT(",。、;:{}",4),计算结果不对
image

2、单元格内输入=RIGHTB(A15,4),A15=,。、;:{} 计算结果不对
image

@univer-bot
Copy link

univer-bot bot commented Oct 17, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

RIGHTB function

  1. Enter =RIGHTB/RIGHT(",.,;:{}",4) in the cell, and the calculation result is incorrect.
    image

  2. Enter =RIGHTB(A15,4), A15=, in the cell. ,;: {} The calculation result is incorrect
    image

@oumomomo
Copy link

oumomomo commented Oct 17, 2024

UNICHAR函数

1、单元格内输入=UNICHAR("2"),计算结果不为空
image

2、单元格内输入=UNICHAR("15"),页面白屏
image

@univer-bot
Copy link

univer-bot bot commented Oct 17, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

UNICHAR function

  1. Enter =UNICHAR("2") in the cell, and the calculation result is not empty.
    image

  2. Enter =UNICHAR("15") in the cell, and the page will be white.
    image

@oumomomo
Copy link

value函数

单元格内输入=VALUE("$1,000")/=VALUE("16:48:00")-VALUE("12:00:00"),计算不出结果
image

@univer-bot
Copy link

univer-bot bot commented Oct 17, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

value function

Enter =VALUE("$1,000")/=VALUE("16:48:00")-VALUE("12:00:00") in the cell, but the result cannot be calculated
image

@oumomomo
Copy link

VALUETOTEXT函数

单元格内输入=VALUETOTEXT(A1, 0),A1=10.000或者1/2 计算结果位数不对
image
image

@univer-bot
Copy link

univer-bot bot commented Oct 17, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

VALUETOTEXT function

Enter =VALUETOTEXT(A1, 0) in the cell, A1=10.000 or 1/2. The number of digits in the calculation result is incorrect.
image
image

@univer-bot univer-bot bot removed the qa:untested This PR is ready to be tested label Oct 18, 2024
@wpxp123456 wpxp123456 force-pushed the feat/add-text-func branch 2 times, most recently from 573ff1b to ecce1b7 Compare October 18, 2024 08:57
@oumomomo oumomomo added the qa:verified This PR has already by verified by a QA and is considered good enough to be merge label Oct 18, 2024
@univer-bot univer-bot bot removed the qa:rejected label Oct 18, 2024

// special case for some characters causing doc stream issues
if (Object.values(DataStreamTreeTokenType).filter((value) => {
return [
Copy link
Member

Choose a reason for hiding this comment

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

It is better to extract constants

@wpxp123456 wpxp123456 merged commit 4094288 into dev Oct 18, 2024
9 checks passed
@wpxp123456 wpxp123456 deleted the feat/add-text-func branch October 18, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qa:verified This PR has already by verified by a QA and is considered good enough to be merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants