!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/main_file/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/   drwxr-xr-x
Free 13.19 GB of 57.97 GB (22.75%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     FractionFormatter.php (2.29 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace PhpOffice\PhpSpreadsheet\Style\NumberFormat;

use 
PhpOffice\PhpSpreadsheet\Calculation\MathTrig;

class 
FractionFormatter extends BaseFormatter
{
    
/**
     * @param mixed $value
     */
    
public static function format($valuestring $format): string
    
{
        
$format self::stripQuotes($format);
        
$value = (float) $value;
        
$absValue abs($value);

        
$sign = ($value 0.0) ? '-' '';

        
$integerPart floor($absValue);

        
$decimalPart self::getDecimal((string) $absValue);
        if (
$decimalPart === '0') {
            return 
"{$sign}{$integerPart}";
        }
        
$decimalLength strlen($decimalPart);
        
$decimalDivisor 10 ** $decimalLength;

        
preg_match('/(#?.*\?)\/(\?+|\d+)/'$format$matches);
        
$formatIntegerPart $matches[1];

        if (
is_numeric($matches[2])) {
            
$fractionDivisor 100 / (int) $matches[2];
        } else {
            
/** @var float */
            
$fractionDivisor MathTrig\Gcd::evaluate((int) $decimalPart$decimalDivisor);
        }

        
$adjustedDecimalPart = (int) round((int) $decimalPart $fractionDivisor0);
        
$adjustedDecimalDivisor $decimalDivisor $fractionDivisor;

        if ((
strpos($formatIntegerPart'0') !== false)) {
            return 
"{$sign}{$integerPart} {$adjustedDecimalPart}/{$adjustedDecimalDivisor}";
        } elseif ((
strpos($formatIntegerPart'#') !== false)) {
            if (
$integerPart == 0) {
                return 
"{$sign}{$adjustedDecimalPart}/{$adjustedDecimalDivisor}";
            }

            return 
"{$sign}{$integerPart} {$adjustedDecimalPart}/{$adjustedDecimalDivisor}";
        } elseif ((
substr($formatIntegerPart03) == '? ?')) {
            if (
$integerPart == 0) {
                
$integerPart '';
            }

            return 
"{$sign}{$integerPart} {$adjustedDecimalPart}/{$adjustedDecimalDivisor}";
        }

        
$adjustedDecimalPart += $integerPart $adjustedDecimalDivisor;

        return 
"{$sign}{$adjustedDecimalPart}/{$adjustedDecimalDivisor}";
    }

    private static function 
getDecimal(string $value): string
    
{
        
$decimalPart '0';
        if (
preg_match('/^\\d*[.](\\d*[1-9])0*$/'$value$matches) === 1) {
            
$decimalPart $matches[1];
        }

        return 
$decimalPart;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0055 ]--