GUI_DispSFloatMin missing zero before comma

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • GUI_DispSFloatMin missing zero before comma

    Hi,

    I get a wrong output from GUI_DispSFloatMin, namely for a fractional value the zero digit before the comma is missing.

    I can reproduce it by adding the following code to the example project delivered with emWin.

    Source Code

    1. GUI_SetFont(&GUI_FontD24x32);
    2. GUI_GotoXY(10, 10);
    3. GUI_DispSFloatMin(-0.00089396257, 3); //output = -.001
    4. GUI_GotoXY(10, 100);
    5. GUI_DispSFloatMin(-0.000999999, 3); //output = -0.001


    Can you confirm this error? If yes, can you provide me a fix or a workaround?

    Thanks,
    David
  • Hello David,

    Thank you for reporting this behavior. I will have a look at this and provide a fixed version of this function in a new emWin version.

    In the meanwhile I would recommend specifying one additional digit for the output:

    C Source Code

    1. GUI_DispSFloatMin(-0.00089396257, 4); //output = -0.0009

    Best regards,
    Adrian