KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

DataGrid customize language decimal #291

Open Michael Wenleder opened this topic on on May 21, 2018 - 2 comments

Michael Wenleder commented on May 21, 2018

Hi Team,

how to set a language specific representation of thousand and decimal signs?

Original DataTables:

$(document).ready(function() {
    $('#example').DataTable( {
        "language": {
            "decimal": ",",
            "thousands": "."
        }
    } );
} );

https://datatables.net/manual/i18n#Ordering-of-numeric-data

I tried following:

DataTables::create(array(
    "dataStore"=>$this->dataStore("xyz"),
    "options"=>array(
        "searching"=>true,
        "paging"=>true,
        "iDisplayLength"=>25,
        "language"=>array(
            "decimal"=>",",
            "thousands"=>"."
        )
    ),
    "columns"=>array(

Thanks!

KoolReport commented on May 22, 2018

Currently you need to define the decimals point and thousand separator for each column:

    "columns"=>array(
        "myColumn"=>array(
            "type"=>"number",
            "decimals"=>2,
            "decimalPoint"=>",",
            "thousandSeparator"=>"."
         )
    )
Michael Wenleder commented on May 22, 2018

Thanks, It worked.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
solved

DataGrid