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

pad character not working properly #23

Closed
wkechel opened this issue Apr 16, 2014 · 5 comments
Closed

pad character not working properly #23

wkechel opened this issue Apr 16, 2014 · 5 comments

Comments

@wkechel
Copy link

wkechel commented Apr 16, 2014

The alternate pad character specification does not work properly:

sprintf("%'#10s",'monkey')
--> "####monkey"
sprintf("%'a10s",'monkey')
"%'a10s"
I think the reason is the regexp. Since # is in the part of the pre-precision/padding spec, it works, but no characters other than [-+'#0 ]* are accepted

@alexei
Copy link
Owner

alexei commented May 1, 2014

I'm not sure I understand your comment. If you mean to suggest that sprintf("%'a10s",'monkey') returns "%'a10s", I'm afraid I can't reproduce this behavior.

@alexei alexei closed this as completed May 1, 2014
@wkechel
Copy link
Author

wkechel commented May 1, 2014

Hi, I am expecting

sprintf("%'a10s",'monkey') --> 'aaaamonkey', i.e. the string shall be
emitted 10 chars wide and padded with a's

On 01.05.14 17:17, Alexandru Mărășteanu wrote:

I'm not sure I understand your comment. If you mean to suggest that
sprintf("%'a10s",'monkey') returns "%'a10s", I'm afraid I can't
reproduce this behavior.


Reply to this email directly or view it on GitHub
#23 (comment).

Wolfgang Kechel mailto:wolfgang.kechel@prs.de

@alexei
Copy link
Owner

alexei commented May 2, 2014

But it does return "aaaamonkey"

@wkechel
Copy link
Author

wkechel commented May 2, 2014

But only for %s, Not for numerical values

Wolfgang Kechel
wolfgang.kechel@prs.demailto:wolfgang.kechel@prs.de

Am 02.05.2014 um 07:32 schrieb "Alexandru Mărășteanu" <notifications@github.commailto:notifications@github.com>:

But it does return "aaaamonkey"


Reply to this email directly or view it on GitHubhttps://github.com//issues/23#issuecomment-41990471.

@alexei
Copy link
Owner

alexei commented May 2, 2014

Please tell me what version are you using, and please show me the code.

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

No branches or pull requests

2 participants