vlauciani/fortran-formatter

PHP Fortran Formatter

v1.11.0 2022-07-05 16:25 UTC

This package is auto-updated.

Last update: 2024-11-05 21:41:04 UTC


README

Tests Packagist License Total Downloads

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