Skip to content

Commit

Permalink
Code style violation corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
sytsereitsma committed Oct 29, 2021
1 parent b99584d commit 43f0c14
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions platform/source/minimal-printf/mbed_printf_implementation.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,17 +287,15 @@ static void mbed_minimal_formatted_string_double(char *buffer, size_t length, in
if (value < 0) {
/* The part after the dot does not have a sign, so negate the value before rounding */
decimal = -decimal_double + 0.5;
if (decimal >= precision)
{
if (decimal >= precision) {
/* Rounding carries over to value's integer part (e.g. -1.95 with dec_precision=1 -> -2.0) */
integer--;
decimal = 0;
}
} else {
/* Round the value */
decimal = decimal_double + 0.5;
if (decimal >= precision)
{
if (decimal >= precision) {
/* Rounding carries over to value's integer part (e.g. 1.95 with dec_precision=1 -> 2.0) */
integer++;
decimal = 0;
Expand Down

0 comments on commit 43f0c14

Please sign in to comment.