Skip to content

Implement :w:p to format numeric values #26

@CHiPs44

Description

@CHiPs44

Allow to specify width and precision when displaying numbers:

...
Var
    Sum: Integer;
    Total: Real;
Begin
    WriteLn('Sum=', Sum:8);
    WriteLn('Total: ', Total:10:2, '');
...

Does it work for strings ?

Allowing negative width to left align instead of right would be great but is explicitly disallowed in FPC docs (https://www.freepascal.org/docs-html/rtl/system/write.html).

"Real numbers are, by default, written in scientific notation"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions