init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
25
lib/PhpSpreadsheet/Style/NumberFormat/BaseFormatter.php
Normal file
25
lib/PhpSpreadsheet/Style/NumberFormat/BaseFormatter.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
|
||||
|
||||
abstract class BaseFormatter
|
||||
{
|
||||
protected static function stripQuotes(string $format): string
|
||||
{
|
||||
// Some non-number strings are quoted, so we'll get rid of the quotes, likewise any positional * symbols
|
||||
return str_replace(['"', '*'], '', $format);
|
||||
}
|
||||
|
||||
protected static function adjustSeparators(string $value): string
|
||||
{
|
||||
$thousandsSeparator = StringHelper::getThousandsSeparator();
|
||||
$decimalSeparator = StringHelper::getDecimalSeparator();
|
||||
if ($thousandsSeparator !== ',' || $decimalSeparator !== '.') {
|
||||
$value = str_replace(['.', ',', "\u{fffd}"], ["\u{fffd}", '.', ','], $value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue