Skip to content

Commit b8b98a5

Browse files
authored
Added decimalIsolate file.
1 parent 564425a commit b8b98a5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Maths/decimalIsolate.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* function isolates the decimal part of a number.
3+
* Take the number and subtract it from the floored number.
4+
* Return the result.
5+
*/
6+
7+
const decimalIsolate = (number) => {
8+
return number - Math.floor(number)
9+
10+
}
11+
12+
// testing
13+
console.log(decimal_isolate(35.345))
14+
console.log(decimal_isolate(56.879))
15+
console.log(decimal_isolate(89.5643))

0 commit comments

Comments
 (0)