[Tex/LaTex] PGFplotstable: Is it possible to set a number format for a *row* instead of a column

pgfplotstabletables

Using pgfplotstable, it's straightforward to set a column number format using

columns/(columnname)/.style={(format)}

What I would like to do is change the number format of a particular row. In my case, the last row of my table is in percent format, whereas the rest of the table is fixed point format.

Is there a way to set the number format of a row, that overrides the number format of all the columns?

As a follow-up question, is there a number format preset for percentages?

Cheers

EDIT:
I've now got it closer to working, thanks to Christian. However, I'm now having an issue where two "%" signs appear in each of the columns that dec sep align creates. How can I remove the first one? See the last row of the image to understand what I mean.

enter image description here

Best Answer

Pgfplotstable has styles like every row no <index> and some other styles as well.

However, these styles are applied quite late in the processing: the content is already fixed at that stage.

I accept this as a feature request.

However, there is a simple way to enable such a style: the styles named every row <rowindex> column <colindex>. These styles allow changes to the content generation, in particular, they respect changes to the number format.

You can group a sequence of such styles to change all values of a specific column easily using

\documentclass{article}

\usepackage{pgfplotstable}

\begin{document}

\pgfplotstableset{
    % #1 = row index
    % #2 = row style keys
    row style/.style 2 args={
        every row #1 column 0/.style={#2},
        every row #1 column 1/.style={#2},
        every row #1 column 2/.style={#2},
        every row #1 column 3/.style={#2},
        every row #1 column 4/.style={#2},
        every row #1 column 5/.style={#2},
        every row #1 column 6/.style={#2},
        every row #1 column 7/.style={#2},
        every row #1 column 8/.style={#2},
        every row #1 column 9/.style={#2},
        every row #1 column 10/.style={#2},
    }
}

\pgfplotstabletypeset[
    row style={3}{sci},
]{
    a b
    0 0
    1 1
    2 2
    3 3
    4 4
    5 5
    6 6
    7 7
    8 8
    9 9
    10 10
}

\end{document}

EDIT: concerning your second question: you wanted to format percentages (i.e. to multiply with 100 and to append '%'):

enter image description here

\documentclass{standalone}

\usepackage{pgfplotstable}

\begin{document}

\pgfplotstabletypeset[
    columns/A/.style={
        column type=r,
        preproc/expr={100*##1},
        postproc cell content/.append style={
            /pgfplots/table/@cell content/.add={}{\%},
        },
        fixed,
        fixed zerofill,
    },
]
{
 A
 0.01
 1
 0.1234
 0.5
}

\end{document}