Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting options for StringElements #15

Open
alecperkins opened this issue Apr 9, 2013 · 1 comment
Open

Formatting options for StringElements #15

alecperkins opened this issue Apr 9, 2013 · 1 comment
Milestone

Comments

@alecperkins
Copy link
Owner

The StringElement should allow for specifying formatting, since right now it just dumps the raw value. Something like [default content]{var_name: %.2f}.

@alecperkins
Copy link
Owner Author

For consistency with the NumberElement display precision and to avoid the rather opaque % formatting, a simpler way would be [default content]{var_name: %0.00} or even [default content]{var_name: 0.00}. Having the % is a nice differentiator, but may be confusing for those who think it means percent or modulo, or for those who expect it to be conventional sprintf-type formatting.

But then there are dates, for which a formatting string would be useful, eg [text content]{var_name: %b %-d, %Y}. (That also raises the question of date input.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant