From 9507b30c7067dd9239e97f7204ff112eff3c0ee3 Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Mon, 21 Oct 2024 18:32:48 +0100 Subject: [PATCH] Fix number rounding This is meant to round up, not round down. --- Sprint-1/exercises/decimal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprint-1/exercises/decimal.js b/Sprint-1/exercises/decimal.js index 143e1c2ac..cc5947ce2 100644 --- a/Sprint-1/exercises/decimal.js +++ b/Sprint-1/exercises/decimal.js @@ -1,9 +1,9 @@ -const num = 56.4567; +const num = 56.5678; // You should look up Math functions for this exercise https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math // Create a variable called wholeNumberPart and assign to it an expression that evaluates to 56 ( the whole number part of num ) -// Create a variable called decimalPart and assign to it an expression that evaluates to 0.4567 ( the decimal part of num ) +// Create a variable called decimalPart and assign to it an expression that evaluates to 0.5678 ( the decimal part of num ) // Create a variable called roundedNum and assign to it an expression that evaluates to 57 ( num rounded to the nearest whole number ) // Log your variables to the console to check your answers