vlauciani / fortran-formatter
PHP Fortran Formatter
Installs: 2 043
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^7.2|^8.0
Requires (Dev)
- orchestra/testbench: ^5.0|^6.0
- phpunit/phpunit: ^8.5.8|^9.3.3
README
Installation
composer require vlauciani/fortran-formatter:^1.0.0
Usage
<?php
namespace App\Api\Controllers;
use App\Http\Controllers\Controller;
use VLauciani\FortranFormatter\Traits\FortranFormatTrait;
class MyController extends Controller
{
use FortranFormatTrait;
public function convertData()
{
$str_pad_string = '*';
$example_1 = self::fromFortranFormatToString('A5', 'ACER', $str_pad_string, STR_PAD_RIGHT); // return: 'ACER*'
$example_2 = self::fromFortranFormatToString('A2', 'IV', $str_pad_string); // return: IV
$example_3 = self::fromFortranFormatToString('F3.0', '12', $str_pad_string); // return: *12
$example_4 = self::fromFortranFormatToString('6X', null, $str_pad_string); // return: ******
$example_5 = self::fromFortranFormatToString('I6', '123', $str_pad_string); // return: ***123
}
}
Contribute
Thanks to your contributions!
Here is a list of users who already contributed to this repository:
Author
(c) 2022 Valentino Lauciani vlauciani[at]gmail.com