Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flabbet/unitsman
A smart Unit Converter
https://github.com/flabbet/unitsman
converter dotnet-core unit-converter
Last synced: 1 day ago
JSON representation
A smart Unit Converter
- Host: GitHub
- URL: https://github.com/flabbet/unitsman
- Owner: flabbet
- License: mit
- Created: 2019-12-17T21:18:55.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T09:26:48.000Z (about 2 years ago)
- Last Synced: 2024-11-04T14:25:04.642Z (about 2 months ago)
- Topics: converter, dotnet-core, unit-converter
- Language: C#
- Size: 98.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![Build Status](https://dev.azure.com/flabbet/Unitsman/_apis/build/status/flabbet.Unitsman?branchName=master)](https://dev.azure.com/flabbet/Unitsman/_build/latest?definitionId=2&branchName=master)
# What is Unitsman?
Unitsman is a lightweighted program that deals very smartly with converting units.
# Requirements
Unitsman requires `.NET Core 3.1` installed.
To build, open .sln file in Visual Studio 2019 for example.# Usage
`Unitsman ` for example
`Unitsman 50 km m` - this will convert 50 kilometers to metersFor conversion precision use `-d <0-15>` or `--decimals <0-15>`
Note: This is a CLI application so it needs to be run in command prompt or terminal
# How smart is it?
Unitsman analyzes unit files very deeply. If there isn't defined a unit but any other references to it, it gets converted. You can check this out by typing `5 "nautical mile" inch`, There isn't nautical mile in Units, but Meter unit is referencing to nautical mile, so it converts: inch -> meter -> nautical mile
Also you don't have to worry about SI prefixes. If there is meter defined, program automatically will recognize km, cm, mm etc. **make sure to use symbols, not names if using SI prefixes**.
Unitsman also deals with complex conversions. At the moment you can smartly convert for example m/s to any length/time unit, you only have to make sure that there is meters per second defined in units, second type can be anything that matches same formula.
For now smart conversions only work for simpler complex types like meters per second. Of course if defined, any complex unit can be converted.
To try it out type `30 m/s in/ms`, this will convert 30 meters per second to inches per millisecond, inches can be anything, same as milliseconds.# Installing new units
Program loads units from Units folder. This folder contains .json files in which unit data is defined. To add new units simply copy json files with new units to Units folder.
# Creating new Units
Units jsons are pretty simple to understand, check out existing ones for reference.