Skip to content

Commit 87cc8f7

Browse files
authored
Fix number rounding (#45)
This is meant to round up, not round down.
1 parent 0a2b5ef commit 87cc8f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sprint-1/exercises/decimal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const num = 56.4567;
1+
const num = 56.5678;
22

33
// You should look up Math functions for this exercise https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math
44

55
// Create a variable called wholeNumberPart and assign to it an expression that evaluates to 56 ( the whole number part of num )
6-
// Create a variable called decimalPart and assign to it an expression that evaluates to 0.4567 ( the decimal part of num )
6+
// Create a variable called decimalPart and assign to it an expression that evaluates to 0.5678 ( the decimal part of num )
77
// Create a variable called roundedNum and assign to it an expression that evaluates to 57 ( num rounded to the nearest whole number )
88

99
// Log your variables to the console to check your answers

0 commit comments

Comments
 (0)