Server IP : 51.89.169.208 / Your IP : 18.223.33.204 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/yellowleaf/public_html/phpMyAdmin/js/src/jqplot/plugins/ |
Upload File : |
/** * jqplot formatter for byte values * * @package phpMyAdmin */ (function ($) { 'use strict'; var formatByte = function (value, index) { var val = value; var i = index; var units = [ Messages.strB, Messages.strKiB, Messages.strMiB, Messages.strGiB, Messages.strTiB, Messages.strPiB, Messages.strEiB ]; while (val >= 1024 && i <= 6) { val /= 1024; i++; } var format = '%.1f'; if (Math.floor(val) === val) { format = '%.0f'; } return $.jqplot.sprintf( format + ' ' + units[i], val ); }; /** * The index indicates what unit the incoming data will be in. * 0 for bytes, 1 for kilobytes and so on... * * @param index * * @return {String} */ $.jqplot.byteFormatter = function (index) { var i = index || 0; return function (format, value) { var val = value; if (typeof val === 'number') { val = parseFloat(val) || 0; return formatByte(val, i); } else { return String(val); } }; }; }(jQuery));