Skip to content

Provide parsing mechanism for fractional number of seconds #5

@autarch

Description

@autarch

Migrated from rt.cpan.org #85771 (status was 'new')

Requestors:

From kwilliams@cpan.org (@kenahoo) on 2013-05-31 18:04:39:

There's a %[number]N field for nanoseconds or microseconds or whatever, but if you have a number of seconds in decimal format with a variable number of decimal places (e.g. 12:34:56.789 PM), it can't be parsed directly. The workaround would be to scan through the data, find the maximum number of decimal places, pad to that length, then use %[number]N. This wouldn't be easy because the "scan through the data" part could require the user to write some pretty fancy parsing machinery.

One solution could be to allow a dot in the %S field, a la %.S . Not sure whether there's a precedent for that or not in other parsing libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions