Skip to content

Conversation

@Abayie
Copy link

@Abayie Abayie commented Oct 30, 2025

Learners, PR Template

Self checklist

  • [x ] I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • [x ] My changes meet the requirements of the task
  • [x ] I have tested my changes
  • [x ] My changes follow the style guide

Changelist

In this pull request I have added improved solutions and comprehensive tests for Sprint 2 of Module-Structuring-and-Testing-Data.
I refactored functions to handle edge cases and ensure correct formatting, such as converting 24-hour time strings to 12-hour clock format with am/pm.
The code now includes robust test cases for different input scenarios, including midnight, noon, single-digit hours, and times close to midnight and noon.
These changes enhance reliability and maintainability, making the code easier to understand and verify for a wide range of data inputs.

Questions

No questions at this point

@jaymes15 jaymes15 self-requested a review November 23, 2025 13:09
@jaymes15 jaymes15 added 📅 Sprint 2 Assigned during Sprint 2 of this module Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Nov 23, 2025

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

function toPounds(penceString) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, clear function name.

function toPounds(penceString) {
// Remove trailing 'p' and pad with zeros to ensure at least 3 digits
const pence = penceString
.substring(0, penceString.length - 1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is clever and handles edge cases very well.

const pounds = pence.substring(0, pence.length - 2);
const pencePart = pence.substring(pence.length - 2).padEnd(2, "0");
// Return formatted string
return ${pounds}.${pencePart}`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Nice that you included the £ symbol directly.

// `current output: ${currentOutput2}, target output: ${targetOutput2}`
// );

function formatAs12HourClock(time) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solid implementation

Copy link

@jaymes15 jaymes15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice One!

@jaymes15 jaymes15 added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants