Skip to content

alvbarbosa/conv-weight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convert weight units

Weight units converter

Description of the module

Conversion is made between the following units:

  • 'kg' Kilogram
  • 'lb' Libra
  • 'stone' stone
  • 'gr' gram
  • 'ton' tons
  • 'oz' ounces The function receives an object with two parameters one is the data of the input data and the other is an array that says which units are the ones that you want to convert

Installation

npm install conv-weight

Uso

import convWeight from 'conv-weight'

const param = {
    in: { weight: 10, unit: "kg" },
    out: ["kg", "lb", "stone", "gr", "ton", "oz"]
};
const result = {
    kg: 10,
    lb: 22.04624,
    stone: 1.57473,
    gr: 10000,
    ton: 0.01,
    oz:352.73991
};
const conv = convWeight(param);

Créditos

Licencia

MIT

About

module to make weight conversion

Resources

License

Stars

Watchers

Forks

Packages

No packages published