This repository was archived by the owner on Feb 20, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ import debounce from './debounce'
7474import curry from './curry'
7575import textJustification from './textJustification'
7676import removeProperty from './removeProperty'
77+ import temperatureConverter from './temperatureConverter'
7778
7879export {
7980 reverseArrayInPlace ,
@@ -152,4 +153,5 @@ export {
152153 textJustification ,
153154 removeProperty ,
154155 dec2hex ,
156+ temperatureConverter ,
155157}
Original file line number Diff line number Diff line change 1+ export default temperatureConverter
2+ /**
3+ * Original Source: https://stackoverflow.com/questions/15122347/
4+ *
5+ * This function gets temperature in fahrenheit and converts it into celsius
6+ *
7+ * @param {Number } fahrenheit - Temperature in fahrenheit
8+ * @return {Number } - Temperature in celsius
9+ */
10+ function temperatureConverter ( fahrenheit ) {
11+ const celsius = ( fahrenheit - 32 ) * 5 / 9
12+ return celsius
13+ }
Original file line number Diff line number Diff line change 1+ import test from 'ava'
2+ import { temperatureConverter } from '../src'
3+
4+ test ( 'converts temperature' , t => {
5+ const number = 78
6+ const expected = ( number - 32 ) * 5 / 9
7+ const actual = temperatureConverter ( number )
8+ t . is ( actual , expected )
9+
10+ } )
You can’t perform that action at this time.
0 commit comments