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

how to use format keyword? #38

Open
smoh opened this issue Jan 27, 2012 · 1 comment
Open

how to use format keyword? #38

smoh opened this issue Jan 27, 2012 · 1 comment
Milestone

Comments

@smoh
Copy link

smoh commented Jan 27, 2012

I want to format the floating point numbers in certain way when I make a table into a ascii file.
I've noticed that the default format for float64 is '25.17e'.
I tried to use format keyword:

t = atpy.Table()
t.add_column('name', data, format='%10.3f')

but when I check t.format('name') = '%1' (i.e. the first two characters..)
I've tried '%10.3f' which gives "Not all argument converted ' error, and '10.3f' which also gives error.
I wasn't able to find any example for the format keyword.

What is the right way to use this keyword?

@astrofrog
Copy link
Member

Try specifying the format without the % and make sure you are using ATpy 0.9.6 - does this work? If so, I can try and make it more robust to whether % is included or not.

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