# Formatting a custom column in pgfplotstable

Following up on my question on PGF custom columns I've successfully created a column but now I'm struggling to format it to fixed, two digit precision.

This seems a little hair trigger in terms of follow on questions, for which my apologies, but it seemed sufficiently different to justify a separate query. Thanks

\documentclass{article}
\usepackage{array}
\usepackage{pgfplotstable}

\begin{document}

\newcolumntype{x}[1]{>{\hspace{1cm}}p{#1}}

\pgfplotstableset{create on use/cagr/.style={create col/expr={(\thisrowno{3}/\thisrowno{0})^(1/3)*100-100}}
}

\pgfplotstabletypeset[string type,debug,
column name={},
columns={0,1,2,3,cagr},
format=inline,col sep=&,row sep=\\,header=false,ignore chars={\^^M},
columns/cagr/.style={column type={x{3cm}},precision={2},fixed,zerofill}]{
1&2&3&4\\
5&6&7&8\\
9&10&11&12\\

}

\end{document}

-

## 1 Answer

The number formatting options aren't applied because you chose the string type option, which turns off the number formatter. Remove string type, and everything works as expected.

-
Thanks @Jake. Incredibly obvious now that I know what I'm looking for! Wouldn't have spotted it in a million years on my own. –  Tahnoon Pasha Nov 5 '12 at 12:48