created two function that takes a parameter
use the conversion formula to convert from fahrenheit to celsius and from celsius to fahrenheit
This commit is contained in:
parent
8c96eb988d
commit
9290e3502c
|
@ -1,11 +1,13 @@
|
||||||
const ftoc = function() {
|
const ftoc = function(f) {
|
||||||
|
return Math.round((f - 32) * (5/9))
|
||||||
|
}
|
||||||
|
const ctof = function(c) {
|
||||||
|
return Math.round(((c * 9/5) + 32))
|
||||||
|
}
|
||||||
|
|
||||||
};
|
ftoc(32)
|
||||||
|
|
||||||
const ctof = function() {
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
ctof(0)
|
||||||
// Do not edit below this line
|
// Do not edit below this line
|
||||||
module.exports = {
|
module.exports = {
|
||||||
ftoc,
|
ftoc,
|
||||||
|
|
Loading…
Reference in New Issue