Skip to content

Commit

Permalink
fix(moneymanagerex#5685): fix decimal values
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriele-v committed Jan 31, 2024
1 parent 17e5fd5 commit 94c6c92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/reports/transactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ table {

if (chart > -1)
{
double value_chart = std::accumulate(total_in_base_curr.begin(), total_in_base_curr.end(), 0,
double value_chart = std::accumulate(total_in_base_curr.begin(), total_in_base_curr.end(), (double)0,
[](const double previous, decltype(*total_in_base_curr.begin()) p) { return previous + p.second; });
values_chart[lastSortLabel] += value_chart;
}
Expand Down Expand Up @@ -488,13 +488,13 @@ table {
{
auto statsMin = std::min_element
(values_chart.begin(), values_chart.end(),
[](const std::pair<wxString, int>& p1, const std::pair<wxString, int>& p2) {
[](const std::pair<wxString, double>& p1, const std::pair<wxString, double>& p2) {
return p1.second < p2.second;
}
);
auto statsMax = std::max_element
(values_chart.begin(), values_chart.end(),
[](const std::pair<wxString, int>& p1, const std::pair<wxString, int>& p2) {
[](const std::pair<wxString, double>& p1, const std::pair<wxString, double>& p2) {
return p1.second < p2.second;
}
);
Expand Down

0 comments on commit 94c6c92

Please sign in to comment.