Formats any array of digits into a valid array of digits

@param   mixed  An array of digits
@return  array  An array of digits
979234
function(obj) {
			var data = [];

			$.each(obj, function(i, value) {
				value = value.toString();
				
				if(value.length == 1) {
					value = '0'+value;
				}
				
				for(var x = 0; x < value.length; x++) {
					data.push(value.charAt(x));
				}				
			});

			if(data.length > this.minimumDigits) {
				this.minimumDigits = data.length;
			}
			
			if(this.minimumDigits > data.length) {
				for(var x = data.length; x < this.minimumDigits; x++) {
					data.unshift('0');
				}
			}

			return data;
		}
1142080
public static function php_number_format($number)
    {

        preg_match('/[.,](\d+)$/', $number, $matches);

        $num_decimals = strlen($matches[1]);

        return preg_replace('/[.,]/', '', $number) / pow(10, $num_decimals);
    }
997387
public static function format($phone)
    {
        // Since we are a US-based application, we want to strip the "+1" US country code to facilitate formatting below
        if (substr($phone, 0, 3) == '+1 ') {
            $phone = str_replace('+1 ', '', $phone);
        }

        // US numbers will have 10 digits. Otherwise, leave alone.
        if (preg_match_all('/[0-9]/', $phone) == 10) {
            $phone = preg_replace('/[^0-9]/', '', $phone);
            $phone = '(' . substr($phone, 0, 3) . ') ' . substr($phone, 3, 3) . '-' . substr($phone, 6);
        }

        // Empty phone values should be made null
        if (empty($phone)) {
            $phone = null;
        }

        return $phone;
    }
292780
public static function format(string $value)
    {
        $value = explode(',', $value);
        if (!is_array($value)) {
            $value = [$value];
        }
        return $value;
    }
567569
protected function asString($number, $digits = 2) {
		$number = (string)$number;
		$count = mb_strlen($number);
		while ($count < $digits) {
			$number = '0' . $number;
			$count++;
		}
		return $number;
	}
394175
public static function format($value)
    {
        $value = (string) $value;
        $arguments = func_get_args();
        $digit = 64;

        if (isset($arguments[1]) && is_numeric($arguments[1])) {
            $digit = intval($arguments[1]);
        }
        $bn = Utils::toBn($value);
        $bnHex = $bn->toHex(true);
        $padded = mb_substr($bnHex, 0, 1);

        if ($padded !== 'f') {
            $padded = '0';
        }        
        return implode('', array_fill(0, $digit-mb_strlen($bnHex), $padded)) . $bnHex;
    }
1239128
protected function formatBoth()
    {
        $data = [];
        $index = 0;

        foreach ($this->getData() as $key => $value) {
            $data[$key] = $value;
            $data[$index] = $value;
            $index++;
        }

        return $data;
    }
265322
public static function formatSocialNumber($number){

		assert('is_integer($number)');

		if(!is_integer($number)) return $number;

		if($number > 10000000){

			$number = round($number / 1000000) . 'M';
		}
		elseif($number > 1000000){

			$number = round($number / 1000000, 1) . 'M';
		}
		elseif($number > 10000){

			$number = round($number / 1000) . 'K';
		}
		elseif($number > 1000){

			$number = round($number / 1000, 1) . 'K';
		}

		return $number;
	}
457361
private function formatParams(array $params) {
        foreach ($params as $key => $value) {
            if (is_array($value)) {
                $params[$key] = implode(',', $value);
            } else if (is_bool($value)) {
                $params[$key] = $value ? 1 : 0;
            }
        }
        return $params;
    }
940437
public static function formatar($cnpj)
    {
        $cnpj = static::digitos($cnpj);
        if (strlen($cnpj) != 14) {
            return "";
        }
        $partes[]    = substr($cnpj, 0, 2);
        $partes[]    = substr($cnpj, 2, 3);
        $partes[]    = substr($cnpj, 5, 3);
        $filiais     = substr($cnpj, 8, 4);
        $verificador = substr($cnpj, 12);

        return implode(".", $partes) . '/' . $filiais . '-' . $verificador;
    }
1224532
public function format(string $format = null, int $numbers = null)
    {
        $numbers = $numbers === null ? static::getDefaultNumbers() : $numbers;
        $format = $format === null ? static::getToStringFormat() : $format;

        $formatArray = str_split($format);
        $dateString = '';

        foreach ($formatArray as $key => $value)
        {
            if (key_exists($value, $this->values))
            {
                $dateString .= $this->values[$value];
                continue;
            }

            $dateString .= $value;
        }

        if ($numbers === static::INDIAN_NUMBERS)
        {
            $dateString = str_replace($this->arabicNumbers, $this->indianNumbers, $dateString);
        }

        return $dateString;
    }
212295
protected function formatResponseArray(array $decryptedArray): array
    {
        $formattedArray = [];

        foreach ($decryptedArray as $key => $value) {
            $formattedArray[$this->formatKey($key)] = $value;
        }

        return $formattedArray;
    }
1184839
public static function formatPhone($phone)
    {
        $ddd = '';
        $phone = self::keepOnlyNumbers($phone);

        // removes leading zero
        if (substr($phone, 0, 1) == 0) {
            $phone = substr($phone, 1);
        }

        // verifies if have ddd
        if (strlen($phone) > 9) {    
            //removes country identifier
            if (strlen($phone) > 11) {
                $phone = substr($phone, 2);
            }
            $ddd = substr($phone, 0, 2);
            $phone = substr($phone, 2);
        }

        return ['areaCode' => $ddd, 'number' => $phone];
    }
94153
private function validateDigits(& $digits)
    {
        ksort($digits);

        if (count($digits) < 2) {
            throw new \InvalidArgumentException('Number base must have at least 2 digits');
        } elseif (array_keys($digits) !== range(0, count($digits) - 1)) {
            throw new \InvalidArgumentException('Invalid digit values in the number base');
        } elseif ($this->detectDuplicates($digits)) {
            throw new \InvalidArgumentException('Number base cannot have duplicate digits');
        }
    }
169446
public function getCheckDigits()
    {
        $checkDigits = '';
        $iban = $this->getIban();
        if (!empty($iban)) {
            $checkDigits = substr($iban, 2, 2);
        }
        return $checkDigits;
    }
647292
public static function format($number, $format=Formatter::PHONE_E164) {
        $formattedNumber = '';
        $regex = "/[^0-9]/";
        $number = preg_replace($regex, "", $number);

        if(strlen($number) > 13)
            throw new \Exception('Unsupported Format for number '.$number);

        if(strlen($number) >10)
            $countryCode = "";
        else
            $countryCode = "91";
        $formattedNumber = "+$countryCode$number";
        return $formattedNumber;
    }
161375
public function encode($numbers)
    {
        if (!is_array($numbers)) {
            $numbers = [$numbers];
        }
        if ($this->signed) {
            $numbers = Signed::encodeBlock($numbers);
        }
        $digits = [];
        $bits = $this->bits;
        $cBit = $this->cBit;
        foreach ($numbers as $number) {
            do {
                $digit = ($number % $this->cBit);
                $number >>= $bits;
                $continue = ($number > 0);
                if ($continue) {
                    $digit += $cBit;
                }
                $digits[] = $digit;
            } while ($continue);
        }
        return $digits;
    }