    private function decToHex($d)
    {
        $h = dechex(round($d));
        $h = str_pad($h, 2, '0', STR_PAD_LEFT);

        return $h;
    }