Socket
Book a DemoInstallSign in
Socket

siconvert

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

siconvert

0.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

Siconvert

Gem to convert your values to SI

Installation

Add this line to your application's Gemfile:

gem 'siconvert'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install siconvert

Usage

At the moment, the gem has 2 main methods - "fromsi", "si".

Gem works with measurements of distance, mass and speed.

  • distance - (inch, feet, yard, verst) - will be converted to meters.

  • mass (lb, ounce, drachma) - will be converted to kilograms.

  • speed (mph) - will be converted to kilometers per hour.

Method "fromsi" converts your SI-value in to all possible alternative values and returns an array to you.

a = Siconvert.new.fromsi(2 ,"distance")
# {"inch"=>78.74, "foot"=>6.562, "yard"=>2.188, "verst"=>0.0018744142455482662}

The value must already be specified in the SI system.

Method - "si" converts your value to SI system.

To do this, pass your value as the first argument, and a value from among those supported by this gem as the second argument.

a = Siconvert.new.si(50 ,"verst")
# 53350

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 15 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.