[英]my jquery datatable shows only round values in amount column , i want to have a values with currency format like $233.25 but it shows $234
My jQuery datatable shows only round values in the amount column, I want to have values with currency format like $233.25
but it shows $234
. 我的jQuery数据表仅在value列中显示取整值,我想使用货币格式的值,例如
$233.25
但显示的是$234
。
HTML table head section:
HTML表头部分:
<thead>
<tr>
<th>Date</th>
<th>SalesNumber</th>
<th>AmountExclGST</th>
<th>GST</th>
<th>TotalAmount</th>
<th>ContactPerson</th>
<th>Status</th>
<th>FullyPaid</th>
<th>Attachment</th>
</tr>
</thead>
My javascript for columns:
我的JavaScript专栏:
{
'data': 'AmountExclGST',
'render': $.fn.dataTable.render.number(',', '.', 2, 'S$')
},
My result column : 我的结果栏:
amount
S$234.00
correct format should be 正确的格式应该是
**Amount
S$233.77**
Please advise me what should I do, in order to get currency format with decimal values ? 请告知我该怎么办才能获得带有十进制值的货币格式?
Use this 用这个
{
'data': 'AmountExclGST',
'render': function ( data, type, row ) {
return parseFloat(data).toFixed(2);
}
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.