【问题标题】:Why does jquery DataTables turn my zero's into floats with values?为什么 jquery DataTables 将我的零变成带有值的浮点数?
【发布时间】:2022-06-14 21:57:42
【问题描述】:

我正在尝试在 jquery 数据表中显示一些 JSON 数据,精度为小数点后两位。有时它似乎有效。在下图中,Chrome 的开发工具栏将值呈现为 2000.0000000,但数据表显示 $2.000020000200002e+58。根据文档 (https://datatables.net/manual/data/renderers#Built-in-helpers),我使用了以下数字渲染器:

 columnDefs: [
        {
            orderable: false,
            render: $.fn.dataTable.render.number(null, null, 2, '$'),
            targets: [4],
        }
    ], 

【问题讨论】:

标签: javascript jquery json datatables


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多