conversion-package
v1.0.3
Published
In this package I created 4 functions which know how to convert
Downloads
2
Maintainers
Readme
Conversion-Package
Introduction:
In this package there are conversion functions written in javascript. The functions can convert "unit of length" and also "Scale of temperature". The functions perform conversions based on an argument that the user enters. It is written in a short and efficient way.
arguments:
- "cm" = The argument input will be
inch
and the output will becentimeter
. - "inch" = The argument input will be
centimeter
and the output will beinch
. - "Tc" = The argument input will be
fahrenheit
and the output will becelsius
. - "Tf" = The argument input will be
celsius
and the output will befahrenheit
.
Example:
"Converts centimeter to inch":
function cm_to_inch(cm){
let inch = cm / 2.54;
console.log(`The result is:`);
console.log(`cm: ${cm} ===` + ` inch: ${inch}`);
}
cm_to_inch(13); // The result is:
cm: 13 === inch: 5.118110236220472
Exports:
module.exports = {
inch_to_cm,
cm_to_inch,
fahrenheit_to_celsius,
celsius_to_fahrenheit
}
How to use:
- installing -
npm install conversion-package
- using -
const package = require('conversion-package');
package.name of the function(appropriate argument);