mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 11:26:13 +00:00
Format packet count with toLocaleString (#4600)
This adjusts to the user's preference: in an English browser, 1234567890 will be shown as 1,234,567,890. JavaScript is already required for widgets to work, adding these toLocaleString calls is not an issue in that regard, and the function is supported in all browsers as far as I can see https://caniuse.com/mdn-javascript_builtins_number_tolocalestring
This commit is contained in:
parent
cde8b431c2
commit
8a607e7552
@ -80,8 +80,8 @@ $ifvalues = array(
|
||||
// fill in stats, use column index to determine td location
|
||||
var item_index = $("#interface_statistics_widget_intf_" + interface_data['descr']).index();
|
||||
if (item_index != -1) {
|
||||
$("#interface_statistics_widget_val_pkg_in > td:eq("+item_index+")").html(interface_data['inpkts']);
|
||||
$("#interface_statistics_widget_val_pkg_out > td:eq("+item_index+")").html(interface_data['outpkts']);
|
||||
$("#interface_statistics_widget_val_pkg_in > td:eq("+item_index+")").html(parseInt(interface_data['inpkts']).toLocaleString());
|
||||
$("#interface_statistics_widget_val_pkg_out > td:eq("+item_index+")").html(parseInt(interface_data['outpkts']).toLocaleString());
|
||||
$("#interface_statistics_widget_val_bytes_in > td:eq("+item_index+")").html(interface_data['inbytes_frmt']);
|
||||
$("#interface_statistics_widget_val_bytes_out > td:eq("+item_index+")").html(interface_data['outbytes_frmt']);
|
||||
$("#interface_statistics_widget_val_errors_in > td:eq("+item_index+")").html(interface_data['inerrs']);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user