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

🐛透视表数据按格式导出,格式显示错误 #2349

Closed
polikesen123 opened this issue Sep 13, 2023 · 2 comments
Closed

🐛透视表数据按格式导出,格式显示错误 #2349

polikesen123 opened this issue Sep 13, 2023 · 2 comments
Assignees

Comments

@polikesen123
Copy link

🏷 Version

Package Version
@antv/s2 1.49.1
@antv/s2-vue 1.5.0

Sheet Type

  • PivotSheet

🖋 Description

透视表数据有用百分号(%)的格式化,使用getSheetData方法带格式导出后,保留一位小数的数据导出后加了一个0变成了两位小数。

⌨️ Code Snapshots

image

const s2DataConfig = { fields: { rows: ['province', 'city'], columns: ['type', 'sub_type'], values: ['number'], }, meta: res.meta.map(it=>{ if(it.field === 'number'){ it.formatter = (value)=>{ return${value / 10}% ; } } return it; }), data: res.data, };

🔗 Reproduce Link

https://codesandbox.io/s/qtx6kp?file=/index.tsx

🤔 Steps to Reproduce

meta中数值字段添加formatter,保留1位小数,并加上%,使用getSheetData方法按格式导出

😊 Expected Behavior

按格式导出数据不对,期待界面上显示的和导出后的的显示一模一样。

😅 Current Behavior

💻 System information

Environment Info
System macOS Ventura Apple M1
Browser chrome v116.0.5845.187
@github-actions github-actions bot added the 💤 inactive 不活跃的 Issue 或 PR, 30天没有回复 label Oct 16, 2023
@lijinke666
Copy link
Member

lijinke666 commented Nov 9, 2023

看了下, 复制没有这个问题, 导出可以复现

@lijinke666 lijinke666 added the 🐛 bug 这个是一个 bug label Nov 9, 2023
@lijinke666 lijinke666 self-assigned this Nov 9, 2023
@lijinke666 lijinke666 removed the 💤 inactive 不活跃的 Issue 或 PR, 30天没有回复 label Nov 9, 2023
@antvis antvis deleted a comment from github-actions bot Nov 10, 2023
@lijinke666
Copy link
Member

lijinke666 commented Nov 10, 2023

和 Excel 的单元格格式有关系, S2 构建的数据是没问题的, Excel 默认是两位小数, 自行修改即可

image

image

image

@lijinke666 lijinke666 removed the 🐛 bug 这个是一个 bug label Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants