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

Can math widget calculate based on other data instead of displayed table data ? #624

Closed
Waynezhi opened this issue May 23, 2014 · 8 comments

Comments

@Waynezhi
Copy link

example, float number precision problem, when i calculate the percent, i leave 4 numbers after comma, and i want to show only 2 number after comma by user friendly, but in the sum cell, it should be calculated based on the float with more precision (if not, the result will be 100.02% instead of 100.00%)

@Waynezhi Waynezhi changed the title Can math widget calculate based on other data instead of table data ? Can math widget calculate based on other data instead of displayed table data ? May 23, 2014
@Mottie
Copy link
Owner

Mottie commented May 23, 2014

Hi @Waynezhi!

Good point! I thought I had included a way to get the cell value from a data-attribute.

I'll have this fixed in the next update. It will get the value from the data-attribute set by the textAttribute option.

@Waynezhi
Copy link
Author

cool, i already added data-mydecimal attribute on each % td, just waiting your fix to get sum,

@Mottie
Copy link
Owner

Mottie commented May 23, 2014

You can get this fix from the working branch: 8d306ab

I forgot to reference this issue.

@Waynezhi
Copy link
Author

i saw in col-custom, we can get an array of cells content, but what i need is an array of cells objects, than get data attribute from each of them and do sum, right ?

@Mottie
Copy link
Owner

Mottie commented May 23, 2014

The array passed to the equation would contain the value from the data-attribute, or cell content if the data-attribute doesn't exist.

Did you need the cell element passed to the equation as well?

@Waynezhi
Copy link
Author

thx @Mottie it should be ok for me with the data-attribute value
on documentation, your said this option should be available in v2.17.1, when is this version going to be online ?

@Mottie
Copy link
Owner

Mottie commented May 27, 2014

I'll update the master branch In the next few days. The fix is already available within the working branch.

@Waynezhi
Copy link
Author

ok that helps me a lot, thx @Mottie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants