Skip to content

dtostrf showing decimal houses even setted to don't have any #835

@fcig

Description

@fcig

Hi
I recently updated the boards package to the lastest version and noticed an issue with dtostrf. It shows a number after the decimal point even when I set it to 0, to not show it.

I tracked the problem and it started with version 2020.11.9 where my skecth is unable to compile with this error:
C:\Users\root\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2020.11.9\cores\maple\avr\dtostrf.c:34:3: error: unknown type name 'uint8_t'
uint8_t negative = 0;

With version 2020.11.14 and later the sketch is able to compile but it shows the mentioned problem. And with version 2020.11.2 it works as expected.

For example, with version 2020.11.2 and before it behaves this way:
dtostrf(Temperature,3,0,text);
The output is "100" , which is fine and expected.

But with version 2020.11.14 and later it behaves this way:
dtostrf(Temperature,3,0,text);
The output is "100.0" , the same output it gives if I use dtostrf(Temperature,3,1,text);

So I'm unable to disable the decimal number.
I'm using a blue pill and Arduino IDE 1.8.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions