jordanbrauer/unit-converter

View on GitHub
src/Calculator/Formula/Length/AstronomicalUnit/ToFeet.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare(strict_types = 1);

/**
 * This file is part of the jordanbrauer/unit-converter PHP package.
 *
 * @copyright 2018 Jordan Brauer <18744334+jordanbrauer@users.noreply.github.com>
 * @license MIT
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace UnitConverter\Calculator\Formula\Length\AstronomicalUnit;

use UnitConverter\Calculator\Formula\Temperature\TemperatureFormula;

/**
 * Formula to convert astronomial unit values to imperial feet.
 *
 * @version 1.0.0
 * @since 0.8.4
 * @author Jordan Brauer <18744334+jordanbrauer@users.noreply.github.com>
 */
final class ToFeet extends TemperatureFormula
{
    const FORMULA_STRING = 'ft = au × 4.908e+11';

    const FORMULA_TEMPLATE = '%sft = %sau × 4.908e+11';

    /**
     * {@inheritDoc}
     */
    public function describe($value, $fromUnits, $toUnits, int $precision = null)
    {
        $result = $this->calculator->mul($value, 490800000000);

        $this->plugVariables($result, $value);

        return $result;
    }
}