nnajm / orb

Pivot table javascript library
https://nnajm.github.io/orb/
MIT License
558 stars 172 forks source link

Prevent non-number in aggregate function #18

Open ValentinH opened 9 years ago

ValentinH commented 9 years ago

I think aggregation on string should not be possible because it leads to weird/unpredictable results: capture d ecran 2015-03-25 a 20 33 01

I have started to work today on a patch that return a blank value when the input data is not a number (using typeof(val) === 'number' because strings like '012' are also unpredictable)

What do you think? Should I submit a PR?

ztrayner commented 9 years ago

@ValentinH Any luck with this patch? It would definitely be useful.

wilcraig commented 8 years ago

Created a patch that I will PR. Creates a new "none" aggregateFunc option to allow using text fields.