crozone / FormatWith

String extensions for named parameterized string formatting.
MIT License
73 stars 13 forks source link

[Feature Request] Allow inclusion of alignment in formatting #36

Open TheodoreBrinkman opened 2 months ago

TheodoreBrinkman commented 2 months ago

FormatWith currently handles only format strings {name:formatString}, but there's an optional alignment section {name,alignmentValue:formatString} that should be handled. I've started by adding a test and some test values in pull 35 (https://github.com/crozone/FormatWith/pull/35), along with a description of what needs to happen in the parsing to allow for it.

For example: for a date variable named 'test', to format it yyyy-MM-dd and left-pad it to 15 characters, the tag should read: {test,15:yyyy-MM-dd}, and the standard format string would be {0,15:yyyy-MM-dd}. To right-pad it, use a negative number.

TheodoreBrinkman commented 2 months ago

@crozone I've gotten a full changeset complete with new tests put together in the linked Pull (#35).