Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.