Please wait...

Float columns

Video versionA video overview of string column in wpDataTables

Float columns in wpDataTablesFloat column type and when to use it

“Float” column type should be used when you need to render numeric values with a decimal part. Even non-float content type from the input will be casted as a number, and render with the amount of numbers after the comma that was defined in the “wpDataTables settings page”.

  • Rendering rules: value is casted as a number, and rendered with number of decimal places, that you defined, after the comma.
  • Sorting rules: arithmetical.
  • Applicable filter types: text (will also work), number, number range, selectbox, checkbox.
  • Issues to note: none.

ExampleA sample table using Float columns

Yearly revenue” column in this table is a Float type column.

wdt_IDCompany nameSectorYearly revenueClient since
1Black TurtleArchitecture10,000,000.0029/05/2011
3Theodore ConsultingTechnology11,000,000.0017/05/2004
4White Wing IndustriesBusiness Consulting1,250,000.0018/05/2006
5Twinkles Inc.IT8,000,000.0001/05/2006
6The Large CompanyConstruction7,000,000.0001/06/2015
8Jailbreak MachineryIT27,500,000.0001/06/2001
9Infinite Scroll ManiacsIT20,000,000.0028/05/1996
10Thebest Construction AgencyConstruction90,000,000.0001/05/1996
11Allen PlanningIT0.0015/12/2017
12Hamburg CallingTechnology2,000,000.0026/08/2004
wdt_IDCompany nameSectorYearly revenueClient since
∑ = 176,750,000.00
Avg = 17,675,000.00
Min = 0.00
Max = 90,000,000.00

Float column settingsHow to configure float columns

The “Float” column type has several interesting features that differ it from other column types.

From version 2.0 and on, you can set “Decimal places” per individual column that represents the number of digits to the right of a decimal point. If you leave this field blank, the column will use the number of decimal places defined on the “wpDataTables settings page.

In addition, there are four calculation features you can enable for the “Float” columns. You can tick these checkboxes to calculate desired functions (Sum, Average, Minimum, Maximum) for all values for a given column. These calculations will be rendered in the table footer as you can see in the example above. See “Calculation functions chapter of this documentation for detailed info.

Do you have the best

essential plugins installed? Grab the best 46 plugins. Tested and sorted.

Plugins for SEO, Caching, Security, Design and UX, Stats & analytics, Social sharing. Only the best ones.

By clicking "subscribe" you consent that the information you provide via this form will be securely processed and stored in compliance with EU privacy laws (GDPR).

Thank you for subscribing! Please check your inbox to download the WordPress goodies.