decimalToHex = function decimalToHex(d, padding) {
      //if there is no padding value added, default padding to 8 else go into while statement.
      padding = (padding === undef || padding === null) ? padding = 8 : padding;
      if (d < 0) {
        d = 0xFFFFFFFF + d + 1;
      }
      var hex = Number(d).toString(16).toUpperCase();
      while (hex.length < padding) {
        hex = "0" + hex;
      }
      if (hex.length >= padding) {
        hex = hex.substring(hex.length - padding, hex.length);
      }
      return hex;
    }
Utility function for formatting numbers into strings and placing appropriate commas to mark
units of 1000. There are two versions, one for formatting ints and one for formatting an array
of ints. The value for the digits parameter should always be a positive integer.

@param {int|int[]|float|float[]} value   the number(s) to format
@param {int} left                        number of digits to the left of the decimal point
@param {int} right                       number of digits to the right of the decimal point

@returns {String or String[]}

@see nf
@see nfs
@see nfp