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
` const dv = new DataSet().createView().source([ { item: '2019', columnValue: 1.01, type: 'a' }, { item: '2019', columnValue: 2.01, type: 'a' }, { item: '2020', columnValue: 1.01, type: 'a' }, { item: '2020', columnValue: 2.22, type: 'a' }, ]) dv.transform({ type: 'aggregate', // 别名summary fields: ['columnValue'], // 统计字段集 operations: ['sum'], // 统计操作集 as: ['value'], // 存储字段集 groupBy: ['item', 'type'], // 分组字段集 })
console.log('dv', dv.rows) `
sum 使用的第三方库 simple-statistics 里面并没有处理浮点计算精度丢失问题
希望能修复这个问题,感谢
The text was updated successfully, but these errors were encountered:
仍然存在这个问题
Sorry, something went wrong.
No branches or pull requests
`
const dv = new DataSet().createView().source([
{
item: '2019',
columnValue: 1.01,
type: 'a'
},
{
item: '2019',
columnValue: 2.01,
type: 'a'
},
{
item: '2020',
columnValue: 1.01,
type: 'a'
},
{
item: '2020',
columnValue: 2.22,
type: 'a'
},
])
dv.transform({
type: 'aggregate', // 别名summary
fields: ['columnValue'], // 统计字段集
operations: ['sum'], // 统计操作集
as: ['value'], // 存储字段集
groupBy: ['item', 'type'], // 分组字段集
})
console.log('dv', dv.rows)
`
输出结果
原因
sum 使用的第三方库 simple-statistics 里面并没有处理浮点计算精度丢失问题
希望能修复这个问题,感谢
The text was updated successfully, but these errors were encountered: