Hi,
there’s no built-in functionality for this, but you could use a plugin filter hook to check the table for numbers and add a “+” in front of every positive number.
I’ve turned this functionality into a TablePress Extension. To use it, just install and activate http://tablepress.org/download/extension/tablepress-plus-sign-positive-numbers.zip like a regular WordPress plugin and extend your table’s Shortcode with another parameter, like
[table id=1 plus_sign_positive_numbers=true /]
After that, all positive numbers in that table will get a “+” sign before them.
Regards,
Tobias
Wow, very nice, thanx! 🙂
Sorry not to have mentioned before, but I would need that “+” sign only to apply in one specific column, not in the whole table. Is it easy to change the Extension-code to apply that functionality?
Hi,
ah, ok 🙂
I’ve extended the Extension so that it now accepts a column number (or even range), so that you can specify on which columns you want this.
Just replace your current version of the Extension with that from a fresh download (same URL as above). After that, you can use a Shortcode like
[table id=1 plus_sign_positive_numbers="3,4,5"/]
which accepts a list of column numbers (and single values of course).
Regards,
Tobias
Hi,
thanks again! I’ve tested the updated Extension and it almost works 🙂
If I add two values, for example “4” and “-2”, it returns the correct value of “+2”. But, if I add the values “+4″ and “-2” it gives an error of !ERROR! unexpected operator '+'. Any solution for this?
Hi,
yes 🙂 Don’t put in a value like “+4” 🙂 Can’t you just leave it as “4”? The extension will add the “+” automatically when the cell is displayed.
Regards,
Tobias
Hi,
yeah, that came into my mind also. Just wondered if there was a simple solution into the code 🙂
But no worries, I’ll modify my tables so that they will work, thanks a lot!
Hi,
no, sorry, I don’t have a solution to this, as that could again interfere with the process of adding the “+” to the calculation results.
Modifying the numbers so that they are without “+” signs initially is the best way to go here.
Best wishes,
Tobias