Table of Contents
How to show currency and percentage values in wpDataTables
Say your company table has a Yearly revenue column that should show $ before each amount, a Growth column that should end with %, and a Stock column with “pcs.” after the number. You don’t need special column types for this. Add a Cell content prefix or Cell content suffix to an Integer or Float column, and the values keep sorting, filtering and calculating as numbers.
How do I make a column show a currency sign with Tabella AI?
Open the table, click Ask Tabella AI and name the column and the type.
- Open the table. Go to wpDataTables → wpDataTables and click the table title.
- Ask Tabella AI. Click Ask Tabella AI and type, for example: Add a $ sign before the values in the Yearly revenue column.
- Check and save. Tabella AI lists what it changed. Click Save Changes, or Undo table changes to go back.
How do I add a currency sign or a unit in the column settings?
Enter the sign in Cell content prefix or Cell content suffix in the Display tab of the column settings.
- Open the column settings. Go to wpDataTables → wpDataTables, open the table and click the settings icon in the column header.
- Check the type. In the Data tab, make sure the type is Integer or Float, so the values sort as numbers.
- Add the prefix or suffix. In the Display tab, enter the text to show before the value in Cell content prefix, for example
$, or after it in Cell content suffix, for example%orpcs. - Save the table. Click Save Changes.
The prefix and suffix show in every cell of the column, but they aren’t part of the value. Visitors still sort the column by value, filter it with number filters and see totals calculated from the numbers. Add a space in the suffix if you want one between the number and the unit.
These examples cover the most common cases:
| Result | Column type | Prefix | Suffix |
|---|---|---|---|
| $1,250.00 | Float | $ |
|
| 1.250,00 € | Float | € |
|
| 12.5% | Float | % |
|
| 40 pcs. | Integer | pcs. |
What should I remember about currency and percentage columns?
Use an Integer or Float column and add the sign or unit in Cell content prefix or Cell content suffix in the column’s Display tab. The values stay numbers, so sorting, number filters and totals keep working, and the separators follow the site’s number format.
Where can I read more?
These pages cover number columns and styling: