Skip to content

Commit

Permalink
Only log warning when truncating integer part, not decimal part
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanel committed Jun 15, 2024
1 parent 1db765e commit a33f2b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.15)
# cmake does not currently support version suffixes (for dev / rc releases for instance.)
# Github actions will detect if version has 'tweak' value (3 '.' in version)
# in order to avoid pushing Docker image for versions in development.
project(coincenter VERSION 3.25.0.0
project(coincenter VERSION 3.24.1
DESCRIPTION "A C++ library centralizing several crypto currencies exchanges REST API into a single all in one tool with a unified interface"
LANGUAGES CXX)

Expand Down
5 changes: 2 additions & 3 deletions src/objects/include/monetaryamount.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,11 @@ class MonetaryAmount {

constexpr int8_t sanitizeIntegralPart(int8_t nbDecs) noexcept {
if (_amount >= kMaxAmountFullNDigits) {
if (!std::is_constant_evaluated()) {
log::warn("Truncating last digit of integral part {} which is too big", _amount);
}
_amount /= 10;
if (nbDecs > 0) {
--nbDecs;
} else if (!std::is_constant_evaluated()) {
log::warn("Truncating last digit of integral part {} which is too big", _amount);
}
}
return nbDecs;
Expand Down

0 comments on commit a33f2b5

Please sign in to comment.