Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amir1376/unit-converter
A kotlin library that handles unit conversation
https://github.com/amir1376/unit-converter
Last synced: about 2 months ago
JSON representation
A kotlin library that handles unit conversation
- Host: GitHub
- URL: https://github.com/amir1376/unit-converter
- Owner: amir1376
- License: apache-2.0
- Created: 2020-06-17T22:39:01.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-15T14:51:52.000Z (over 2 years ago)
- Last Synced: 2024-10-14T06:47:01.044Z (3 months ago)
- Language: Kotlin
- Size: 78.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unit Converter
A kotlin library that handles unit conversation# Usage
here is an example to demonstrate how it works
```kotlin
fun main(){
val converted=(2 withUnit k(Bytes)).convertTo(M(Bits))
}
```
declaring a custom unit
```kotlin
//declaring speed units
val kBs=K(Bytes) per Second
val Mbs=M(Bits) per Second
//converting from Mb/s to kB/s
val convertedSpeed=(2 witUnit Mbs).convertTo(kBs)
```
# Supported types
supported types are under `ir.amirabdol.unitconverter.type.availabletypes` package
you can also create types thats are depends on more than two types like Speed and more by using `FractionType`# Contribution
you can add another Type and its Units to this project
or if you found any bug please consider a pull request