Skip to content

Commit 02aaf2a

Browse files
committed
Fix inconsistent code formatting
1 parent a74b44e commit 02aaf2a

File tree

2 files changed

+21
-25
lines changed

2 files changed

+21
-25
lines changed

Sprint-2/3-mandatory-implement/1-bmi.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
// It should return their Body Mass Index to 1 decimal place
1616

1717
function calculateBMI(weight, height) {
18-
// return the BMI of someone based off their weight and height
19-
let bmi = weight / (height * height);
20-
bmi = Number(bmi.toFixed(1));
21-
return bmi;
18+
// return the BMI of someone based off their weight and height
19+
let bmi = weight / (height * height);
20+
bmi = Number(bmi.toFixed(1));
21+
return bmi;
2222
}
2323

2424
let actualOutput = calculateBMI(70, 1.73);
25-
console.log(actualOutput); // 23.4
25+
console.log(actualOutput); // 23.4

Sprint-2/3-mandatory-implement/3-to-pounds.js

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,28 @@
55

66
// You should call this function a number of times to check it works for different inputs
77

8-
9-
108
function toPounds(penceString) {
11-
const penceStringWithoutTrailingP = penceString.substring(
12-
0,
13-
penceString.length - 1
14-
);
9+
const penceStringWithoutTrailingP = penceString.substring(
10+
0,
11+
penceString.length - 1
12+
);
1513

16-
const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0");
17-
const pounds = paddedPenceNumberString.substring(
18-
0,
19-
paddedPenceNumberString.length - 2
20-
);
14+
const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0");
15+
const pounds = paddedPenceNumberString.substring(
16+
0,
17+
paddedPenceNumberString.length - 2
18+
);
2119

22-
const pence = paddedPenceNumberString
23-
.substring(paddedPenceNumberString.length - 2)
24-
.padEnd(2, "0");
20+
const pence = paddedPenceNumberString
21+
.substring(paddedPenceNumberString.length - 2)
22+
.padEnd(2, "0");
2523

2624
return ${pounds}.${pence}`;
2725

28-
// console.log(`£${pounds}.${pence}`);
26+
// console.log(`£${pounds}.${pence}`);
2927
}
3028

31-
32-
33-
console.log(toPounds("399p"));
34-
console.log(toPounds("5p"));
35-
console.log(toPounds("50p"));
29+
console.log(toPounds("399p"));
30+
console.log(toPounds("5p"));
31+
console.log(toPounds("50p"));
3632
console.log(toPounds("1234p"));

0 commit comments

Comments
 (0)