42 lines
859 B
PHP
42 lines
859 B
PHP
<?php
|
|
|
|
namespace App\Actions\Generate\Utilities;
|
|
|
|
class Format
|
|
{
|
|
public static function seite($value)
|
|
{
|
|
if ($value * 1 > 0) {
|
|
return $value;
|
|
} else {
|
|
return '';
|
|
}
|
|
}
|
|
|
|
public static function index($value)
|
|
{
|
|
if (is_numeric($value) && $value * 1 > 0) {
|
|
return number_format($value, 2, '.', '.');
|
|
} else {
|
|
return '';
|
|
}
|
|
}
|
|
|
|
public static function dezimal($value, $stellen = 2)
|
|
{
|
|
if (is_numeric($value) && $value * 1 > 0) {
|
|
return number_format($value, $stellen, ',', '.');
|
|
} else {
|
|
return '';
|
|
}
|
|
}
|
|
|
|
public static function fix_str($str)
|
|
{
|
|
$from = ['--', 'text-align: end;'];
|
|
$to = ['', 'text-align: right;'];
|
|
|
|
return str_replace($from, $to, $str);
|
|
}
|
|
}
|