atpy/atpy — Issue #38: how to use format keyword?
Author: smoh
Created: 2012-01-27 09:55:37+00:00
State: open

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?