function d2h(d) {
    var hex = Math.round(d).toString(16);
    while (hex.length < 2)
      hex = '0' + hex;
    return hex;
  }
/**
   * Convert a decimal to a 2 digit hex string
   *
   * @param d  {int} a decimal number
   *
   * returns a digit hex string
   *
   * ex: 9 => '09', 13 => '0d'
   */
Convert a decimal to a 2 digit hex string
@param d  {int} a decimal number

returns a digit hex string


Convert a decimal to a 2 digit hex string @param d { int } a decimal number returns a digit hex string
function d2h(d) {
    var hex = Math.round(d).toString(16);
    while (hex.length < 2)
      hex = '0' + hex;
    return hex;
  }
function d2h ( d ) { var hex = Math . round ( d ) . toString ( 16 ) ; while ( hex . length < 2 ) hex = '0' + hex ; return hex ; }
Convert a decimal to a 2 digit hex string
 @param d  {int} a decimal number
Convert a decimal to a 2 digit hex string @param d { int } a decimal number