Git Product home page Git Product logo

units's Introduction

units

units gives you units libraries in popular programming languages.

What? Why? How?

units provides you tools for using units and units conversions easily in your favorite language.

Our main goal is:

To create a library of units handling that will validate that the user uses the right units in their code

Our secondary goals are:

  • To do those validations in compile time (when possible) in order to prevent performance issues.
  • To support basic usage such as summation, subtraction, comparison, etc. of units.
  • To maintain high accuracy when using units (especially in casting from one unit to another).
  • To support insertion of new units to the library easily.
  • To correlate the unit scales in all supported languages for multi-platform projects

How do we do this? learn how by reading the README.md file in the most suitable language file for you:

Look here to see in which units do we support.

Look here to see the units conversion table.

Look here to see the constants included in our libraries.

For more details about our libraries, go here.

Future Supported Languages and Platforms

  • Java
  • Python
  • C#
  • .NET

units's People

Contributors

benjamingr avatar oriash93 avatar saroad2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

benjamingr

units's Issues

Invalid order of tags passed to duration classes

Regarding Duration,

In Days and Years (as you do in all classes that are NumericValues),
you pass the unit tag first (duration_tag), and then the scale tag (days_tag).
In classes that are created with Duration, you pass the scale tag before the unit tag
F.E:

  • using Minutes = Duration<std::chrono::minutes, minutes_tag, duration_tag>;
  • using Days = NumericValue<days_tag, duration_tag>;

Fix conversions.md generation

For some reason, conversions.md is generated differently, which makes the output looks wrong.

Before:

image

After:

image

I suspect it's possibly one of the last commits regarding the .stg, maybe it's an HTML issue.

Side note 1: Should change "MANUALY" to "MANUALLY"
Side note 2: Maybe comment out the "don't touch auto-generated files" decleration?
It should be visible to the developer, not to the user.

Inconsistent scale calculation in duration classes

Regarding Duration,

Lines 53-55 and 64-66 calculate scale based on conversions from chrono classes for minutes_tag and hours_tag, unlike days_tag and years_tag that are calculated based on their previous tags scale.

Do you do that because there's no suitable method for these scales? Perhaps it's better for clarity to simplify calculation in minutes_tag and hours_tag instead of using conversions from chrono?

Also, you can make a template method out of what's going on in the lines I've stated above, it might help in clarity if you want to keep conversions based on chrono.

Create a README.md file

Hello loser, you should probably create a README.md file for introduction and basic usage, and probably a docs folder with .md files that document stuff

units_generator: Error while trying to copy supported units file

FAILURE: Build failed with an exception.

  • Where:
    Build file 'C:\Repositories\units\build.gradle' line: 47

  • What went wrong:
    Execution failed for task ':generate'.

Failed to capture snapshot of output files for task 'copyGeneratedSupportedUnits' property 'destinationDir' during up-to-date check.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED in 34s
1 actionable task: 1 executed

Full output
Full output with --stacktrace

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.