GithubHelp home page GithubHelp logo

convertor's Introduction

Hi ๐Ÿ‘‹ My name is Oli Folkerd

Head of Development at Event Engineering Ltd

Builder of crazy contraptions,Tabulator tinkerer

  • ๐ŸŒย  I'm based in England
  • ๐Ÿ’ฌ Ask me about Tabulator JavaScript Tables
  • ๐Ÿš€ย  I'm currently working on Tabulator
  • ๐Ÿคย  I'm open to collaborating on interesting projects

Skills

JavaScript PHP C Git HTML5 CSS3 Sass Vue Bootstrap Babel Webpack JQuery NodeJS Express MySQL Laravel Photoshop Illustrator XD Figma

Socials

Badges

My GitHub Stats

olifolkerd's GitHub stats

Top Repositories








convertor's People

Contributors

barton-webwings avatar curtisdhi avatar frontendcoffee avatar fwidm avatar marcobax avatar olifolkerd avatar scotthavens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

convertor's Issues

Why Post this?

Tell me more about your engineering level, so we can lol.

How to display/handle error validation on empty units?

$simpleConvertor->to("ft"); //returns converted value

If the user put wrong unit or leave the unit empty, eg: $simpleConvertor->to("fttttt"); display this "you have entered wrong or empty unit" or redirect to 404 page. How to do this?

Im getting so many error logs:

[05-Aug-2017 23:06:58 UTC] PHP Fatal error: Uncaught exception 'Exception' with message 'Unit Not Set' in /public_html/Convertor.php:1020
Stack trace:
#0 /public_html/xxx.php(3): Convertor->to('')
#1 /public_html/xxxx.php(176): include('/xxx...')
#2 {main}
thrown in /public_html/Convertor.php on line 1020

Time Conversion

Big errors in your time conversion. There are 60 seconds in a minute. Not 30.

Array to string conversion

Hello

this is a simple code trying to convert s to day / hour / min
Ps :I'm using php 7

<?php
include("Convertor.php");

$simpleConvertor = new Convertor(1209867, "s");
var_dump($simpleConvertor->to(array('day', 'hr', 'min')));

this is the result:

array(3) {
  ["day"]=>
  float(14.003090277778)
  ["hr"]=>
  float(336.07416666667)
  ["min"]=>
  float(40328.9)
}

would be good to get the correct convert seconds to day(if possible ) / hours / min

like :

14 days 4 minutes 27 seconds

Thanks

Add conversion tests

There are already several tests for various kinds of versions.

There are however, a few tests missing:

  • Conversion of area
  • Conversion of volume
  • Conversion of power

This was already mentioned in a todo in the code, I just moved it to here.

Support composer

I think, you should provide a more modern way to include this lib.

Quality Assurance (and CI)

It's nice that the package already contains a test suite.

It would be nice if it also had:

  • PHP-CS-Fixer
  • PHPStan

And maybe most importantly:

  • CI (for instance: Github Actions)

I would be happy to create a PR for this.

Heavy modifications in Convertor Fork & PR

Hi, recently I've made Pull Request to bring convertor into the composer-compatible form. Turns out i needed to change quite some things to fit it to my application.

Features:

  • Empty constructor is now possible (to call from and to later on)
  • Units are now exchangeable by loading from different files
  • Added more exceptions to differentiate between problems
  • Added another Units file with other notations (km^2 => km2, kg/m^2 => kg m-2)
  • Added PHPUnit tests

So I've thought i should ask before submitting a PR in case it is too bloaty for you. My fork can be found here if you want to take a look first.

Wasn't too sure about PR etiquette on github if you heavily modify another project :D.

Let me know what you think.

Format the files with PSR

To get more compatible with other frameworks, i would suggest, that the file/files are formatted with psr.

Meter cubic conversion error

"m3"=>array("base"=>"l", "conversion"=>1), //meters cubed

A liter is a cubic decimeter, and most certainly not a cubic meter

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.