Skip to content

New Feature Request - optimized right/left padding %s option #100

Open
@dhartford

Description

@dhartford

Hi team,
Evaluating quicktemplate for fixed length file generation, I'm rather impressed with the speed and efficiency!

I did find, as documented, if you start using non-optimal methods (sprintf formatting) it does increase the time (in my usecase, from 20 microseconds to 30 microseconds for a random fixed length scenario, 50% increase in time).

Ask:
Similar to #8, would there be a way to create an optimized version for string padding left/right?

{%s20 or {%s-20 for example syntax.

Concerns:
If a future feature was needed to SLICE strings down to the same length (also necessary for fixed length, trimming remainder after the cutoff point), not sure how to ensure the right capabilty and syntax for right PAD v left PAD vs SLICE or the 'always' fixed length with Slice/right-Pad or slice/left-pad at the same time.

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