Skip to content

[BUG] - %f format string does not work in StrPrint and friends #137

@Jamesbarford

Description

@Jamesbarford

Describe the bug
Using the %f formatting to format a float in a printf like function in HolyC does not work

Example Program

U0 Main()
{
  F64 f = 65.3;
  U8 *str = StrPrint(,"%f",f); // This line explodes
  "%s\n",str;                  // Should print: 65.3
  Free(str);
}

Expected behavior
The %f formatting should convert the float to a string without using something like C's snprintf(...). But possibly be ported out of TempleOS StrPrint.HC or another custom implementation written.

The function that we need to modifiy is ./src/holyc-lib/strings.HC

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions