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

Totals rounding #386

Closed
eXicRa opened this issue Apr 24, 2023 · 2 comments
Closed

Totals rounding #386

eXicRa opened this issue Apr 24, 2023 · 2 comments

Comments

@eXicRa
Copy link

eXicRa commented Apr 24, 2023

Is it possible to round the totals?
So I could round the totals I calculated but not the predefined "Sum" and "Average". If I disable the predefined one, I got a null exception for e.g. SumValue.

So it would be nice to disable only the predefined totals from displaying, than I could easily calculate I want and round myself.

.Calculate("Sum", x => Math.Round(c.Get("TestCol").SumValue.Number.Value,2))

image

@gustavnavar
Copy link
Owner

You can use format for a column. For example:

c.Add(o => o.Freight)
    .Format("{0:#,##0.000}")
    .Sum(true).Average(true);

The format will apply to all column values, including the totals.

@eXicRa
Copy link
Author

eXicRa commented May 2, 2023

Thanks a lot, this helped me. Great work with this component.

@eXicRa eXicRa closed this as completed May 2, 2023
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

No branches or pull requests

2 participants