diff --git a/wiring_serial.c b/wiring_serial.c index 62c4be4..92da993 100644 --- a/wiring_serial.c +++ b/wiring_serial.c @@ -24,6 +24,7 @@ //#include "wiring_private.h" #include +#include #include #include @@ -176,7 +177,7 @@ void printFloat(double n) fractional_part = modf(n, &integer_part); printInteger(integer_part); printByte('.'); - printInteger(round(fractional_part*1000)); + printInteger(labs(round(fractional_part*1000))); } // void printHex(unsigned long n)