Giter VIP home page Giter VIP logo

unit-converter's Introduction

Unit Converter

Latest Stable Version Latest Unstable Version Travis Code Maintainability Code Coverage Technical Debt

Maintenance Packagist PHP from Packagist composer.lock available license


Convert all kinds of standard units of measurement from one to another with this highly customizable, easy to use, lightweight PHP component.

Table of Contents:

  1. About the Component
  2. Installing the Component
  3. Basic Usage

1. About the Component

This unit converter component aims to be modern and follow best practices. It also aims to be fully SI compliant (eventually...).

It supports the following types of measurement by default (support for more measurement types are on the roadmap).

  • Area
  • Data Transfer Rates Coming Soon!
  • Digital Storage Coming Soon!
  • Energy (Power)
  • Frequency New!
  • Fuel Economy New!
  • Length
  • Mass (Weight)
  • Plane Angle (Rotation)
  • Pressure
  • Speed
  • Temperature
  • Time
  • Volume

You also have the ability to override & customize the default units, as well as add your own!

2. Installing the Component

The best way to install the component is with Composer. For other supported methods, see the wiki artile on installation.

$ composer require jordanbrauer/unit-converter

3. Basic Usage

Using the component is very easy, especially if you have used the Symfony or Laravel frameworks before.

Quick-Start

If you'd like to skip the minutiae of this component's setup and get right down to business, you can get started by constructing a pre-configured converter via the builder object, like so,

use UnitConverter\UnitConverter;

$converter = UnitConverter::createBuilder()
    ->addSimpleCalculator()
    ->addDefaultRegistry()
    ->build();

and use it like this,

$converter->convert(1)->from("in")->to("cm"); # (float) 2.54

and you're done! For a more in-depth setup guide, check the wiki.

User Documentation

Setup guides, in-depth examples, tutorials, and explanations on the component for users who are looking to integrate it into their project, as-is.

User Documentation

API Documentation

If you are looking to extend and hack on this component for your own project, these pages will give you insight into all about how the component works, through the awesome power of dockblocks!

API Documentation

unit-converter's People

Contributors

jordanbrauer avatar jmauerhan avatar progi1984 avatar proualexandre avatar elliotwms avatar

Watchers

James Cloos avatar Nikolya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.