Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php
private static function nbrConversionFormat($xVal, $places)
    {
        if ($places !== null) {
            if (is_numeric($places)) {
                $places = (int) $places;
            } else {
                return Functions::VALUE();
            }
            if ($places < 0) {
                return Functions::NAN();
            }
            if (strlen($xVal) <= $places) {
                return substr(str_pad($xVal, $places, '0', STR_PAD_LEFT), -10);
            }

            return Functions::NAN();
        }

        return substr($xVal, -10);
    }
private static function nbrConversionFormat($xVal, $places)
    {
        if ($places !== null) {
            if (is_numeric($places)) {
                $places = (int) $places;
            } else {
                return Functions::VALUE();
            }
            if ($places < 0) {
                return Functions::NAN();
            }
            if (strlen($xVal) <= $places) {
                return substr(str_pad($xVal, $places, '0', STR_PAD_LEFT), -10);
            }

            return Functions::NAN();
        }

        return substr($xVal, -10);
    }
private static function nbrConversionFormat ( $ xVal , $ places ) { if ( $ places !== null ) { if ( is_numeric ( $ places ) ) { $ places = ( int ) $ places ; } else { return Functions :: VALUE ( ) ; } if ( $ places < 0 ) { return Functions :: NAN ( ) ; } if ( strlen ( $ xVal ) <= $ places ) { return substr ( str_pad ( $ xVal , $ places , '0' , STR_PAD_LEFT ) , - 10 ) ; } return Functions :: NAN ( ) ; } return substr ( $ xVal , - 10 ) ; }
Formats a number base string value with leading zeroes.

@param string $xVal The "number" to pad
@param int $places The length that we want to pad this value

@return string The padded "number"
Formats a number base string value with leading zeroes .