We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
透视表数据有用百分号(%)的格式化,使用getSheetData方法带格式导出后,保留一位小数的数据导出后加了一个0变成了两位小数。
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, };
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
; } } return it; }), data: res.data, };
https://codesandbox.io/s/qtx6kp?file=/index.tsx
meta中数值字段添加formatter,保留1位小数,并加上%,使用getSheetData方法按格式导出
按格式导出数据不对,期待界面上显示的和导出后的的显示一模一样。
The text was updated successfully, but these errors were encountered:
看了下, 复制没有这个问题, 导出可以复现
Sorry, something went wrong.
和 Excel 的单元格格式有关系, S2 构建的数据是没问题的, Excel 默认是两位小数, 自行修改即可
lijinke666
No branches or pull requests
🏷 Version
Sheet Type
🖋 Description
透视表数据有用百分号(%)的格式化,使用getSheetData方法带格式导出后,保留一位小数的数据导出后加了一个0变成了两位小数。
⌨️ Code Snapshots
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
The text was updated successfully, but these errors were encountered: