Skip to content

Commit

Permalink
refactor: improve 02-numbers-tasks solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-koran committed Dec 10, 2024
1 parent 6ae80cd commit 0ce334d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/02-numbers-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function getRectangleArea(width, height) {
* 0 => 0
*/
function getCircleCircumference(radius) {
return 2 * radius * Math.PI;
return 2 * Math.PI * radius;
}

/**
Expand Down Expand Up @@ -141,7 +141,7 @@ function getLastDigit(value) {
* '-525.5' => -525.5
*/
function parseNumberFromString(value) {
return +value;
return Number(value);
}

/**
Expand Down Expand Up @@ -179,7 +179,7 @@ function getParallelepipedDiagonal(a, b, c) {
* 1678, 3 => 2000
*/
function roundToPowerOfTen(num, pow) {
return pow === 0 ? num : Math.round(num / (10 ** pow)) * (10 ** pow);
return pow === 0 ? num : Math.round(num / 10 ** pow) * 10 ** pow;
}

/**
Expand Down

0 comments on commit 0ce334d

Please sign in to comment.