All Projects → martinlindhe → Unit

martinlindhe / Unit

Licence: mit
Conversion of unit library for golang

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Unit

Rink Rs
Unit conversion tool and library written in rust
Stars: ✭ 242 (+202.5%)
Mutual labels:  units-of-measure, conversion
Length.js
📏 JavaScript library for length units conversion.
Stars: ✭ 292 (+265%)
Mutual labels:  units-of-measure, conversion
Unitsnet
Makes life working with units of measurement just a little bit better.
Stars: ✭ 641 (+701.25%)
Mutual labels:  units-of-measure, conversion
Unicopy
Unicode command-line codepoint dumper
Stars: ✭ 16 (-80%)
Mutual labels:  conversion
Convertpcltocore
17 Steps to Convert your PCL to .NET Standard
Stars: ✭ 10 (-87.5%)
Mutual labels:  conversion
0xc
Easy base conversion in emacs
Stars: ✭ 42 (-47.5%)
Mutual labels:  conversion
Units Of Measure
Type-safe dimensional analysis and unit conversion in Kotlin.
Stars: ✭ 69 (-13.75%)
Mutual labels:  units-of-measure
Metapensiero.pj
Javascript for refined palates: a Python 3 to ES6 Javascript translator
Stars: ✭ 752 (+840%)
Mutual labels:  conversion
Delorean
Convert Task to Future, and Future to Task
Stars: ✭ 63 (-21.25%)
Mutual labels:  conversion
Cryptii
Web app and framework offering modular conversion, encoding and encryption
Stars: ✭ 971 (+1113.75%)
Mutual labels:  conversion
Units Converter
A simple utility library to measure and convert between units
Stars: ✭ 31 (-61.25%)
Mutual labels:  conversion
Csprojtovs2017
Tooling for converting pre 2017 project to the new Visual Studio 2017 format.
Stars: ✭ 876 (+995%)
Mutual labels:  conversion
Darknet2caffe
Convert Darknet model to Caffe's
Stars: ✭ 46 (-42.5%)
Mutual labels:  conversion
Barril
Python package to manage units for physical quantities
Stars: ✭ 25 (-68.75%)
Mutual labels:  units-of-measure
Batch textures convert
🔁 Batch texture conversion to various render-friendly mip-mapped formats
Stars: ✭ 67 (-16.25%)
Mutual labels:  conversion
Simple Java Mail
Simple API, Complex Emails (JavaMail smtp wrapper)
Stars: ✭ 821 (+926.25%)
Mutual labels:  conversion
Normalize country
Convert country names and codes to a standard.
Stars: ✭ 60 (-25%)
Mutual labels:  conversion
Ssp
C++ CSV parser
Stars: ✭ 30 (-62.5%)
Mutual labels:  conversion
Bib Rdf Pipeline
Scripts and configuration for converting MARC bibliographic records into RDF
Stars: ✭ 27 (-66.25%)
Mutual labels:  conversion
Vchsm
C++ 11 algorithm implementation for voice conversion using harmonic plus stochastic models
Stars: ✭ 38 (-52.5%)
Mutual labels:  conversion

About

Travis-CI codecov.io GoDoc

Conversion of unit library for golang

Installation

go get -u github.com/martinlindhe/unit

General use

Basic usage:

ft := 1 * unit.Foot
fmt.Println(ft.Feet(), "feet is", ft.Meters(), "meters")

To use your own data type, you need to convert to the base unit first (eg Length, Speed etc):

type MyUnit int

n := MyUnit(2)
ft := Length(n) * Foot
fmt.Println(ft.Feet(), "feet is", ft.Meters(), "meters")

Temperature

Cannot be used to scale directly like the other units. Instead, use the From* functions to create a Temperature type:

f := unit.FromFahrenheit(100)

fmt.Println("100 fahrenheit in celsius = ", f.Celsius())

Future work

Please note the resulting precision is limited to the float64 type. Big decimal version is being tracked in https://github.com/martinlindhe/unit/issues/3

License

Under MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].