Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
save_bvnghean.vn
/
wp-content
/
plugins
/
wpDataTables_v1.6.1
/
source
:
class.float.wpdatacolumn.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php class FloatWDTColumn extends WDTColumn { protected $_jsDataType = 'formatted-num'; protected $_dataType = 'float'; public function __construct( $properties = array () ) { parent::__construct( $properties ); $this->dataType = 'float'; $this->_jsFilterType = 'number'; $this->addCSSClass('numdata float'); } public function prepareCellOutput( $content ) { if( $content == '' ){ return $content; } $number_format = get_option('wdtNumberFormat') ? get_option('wdtNumberFormat') : 1; $decimal_places = get_option('wdtDecimalPlaces') !== false ? get_option('wdtDecimalPlaces') : 2; if($number_format == 1){ $formattedValue = number_format( (float) $content, $decimal_places, ',', $this->thousandsSeparatorVisible() ? '.' : '' ); }else{ $formattedValue = number_format( (float) $content, $decimal_places, '.', $this->thousandsSeparatorVisible() ? ',' : '' ); } $formattedValue = apply_filters( 'wpdatatables_filter_float_cell', $formattedValue ); return $formattedValue; } public function getGoogleChartColumnType(){ return 'number'; } } ?>