Skip to content

fix(aggregate): include first row in SUM and coerce numeric strings - #9

Open
namannitr wants to merge 1 commit into
100pah:mainfrom
namannitr:fix-1
Open

fix(aggregate): include first row in SUM and coerce numeric strings#9
namannitr wants to merge 1 commit into
100pah:mainfrom
namannitr:fix-1

Conversation

@namannitr

Copy link
Copy Markdown

Summary

  • src/aggregate.ts already seeded SUM from the first in-group value (PR Fix for #1 #3 / issue initial value of sum should be the first value instead of 0 #1), but dist/ecSimpleTransform.js was never rebuilt, so npm and jsDelivr still ship SUM: function () { return 0; }. Singleton groups therefore SUM to 0, and multi-row groups skip the first row.
  • Arithmetic methods now coerce cells with Number(...) so object-row sources like { billAmount: '400' } add as numbers instead of concatenating strings (issue Sum method not giving correct result #6).
  • Rebuilt dist/ (including the min bundle jsDelivr points at) and added npm test coverage for both cases.

Test plan

  • npm run release && npm test — covers singleton SUM, multi-row SUM including the first row, and the billAmount string fixture from Sum method not giving correct result #6 (Mar=1000, April=210, August=148)
  • After merge, please publish a new npm version so CDN users pick this up (jsDelivr serves dist/ecSimpleTransform.min.js)

Made with Cursor

…ngs.

The source fix for 100pah#1 never landed in dist, so npm/jsDelivr still skip the first row of every group. Rebuild the bundle and coerce string cells so 100pah#6 sums as numbers rather than concatenating.

Co-authored-by: Cursor <cursoragent@cursor.com>
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

Successfully merging this pull request may close these issues.

1 participant