Skip to content

Birmingham | ITP-May-2025 | Peter Lui | S&TD Sprint 2#549

Closed
petergmlui wants to merge 5 commits intoCodeYourFuture:mainfrom
petergmlui:coursework/sprint-2
Closed

Birmingham | ITP-May-2025 | Peter Lui | S&TD Sprint 2#549
petergmlui wants to merge 5 commits intoCodeYourFuture:mainfrom
petergmlui:coursework/sprint-2

Conversation

@petergmlui
Copy link

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with REGION | COHORT_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Initial submission

Questions

Ask any questions you have for your reviewer.

@petergmlui petergmlui added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 15, 2025
@LonMcGregor LonMcGregor added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 3, 2025
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

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

Good answers. There's one small part where you might want to take another look. Other than that, good work.


// round to 1 decimal place
bmi = (Math.round((bmi*10)))/10;

Choose a reason for hiding this comment

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

There might be a cleaner way to get 1 decimal place. Multiplying by 10 and then dividing by 10 a bit complicated.

Copy link
Author

Choose a reason for hiding this comment

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

@LonMcGregor Thank you for your review! While I understand what you mean, using toFixed(1) is easier, but toFixed() returns a string, and round() returns a number. The instructions were not that clear about returning a string or a number, can you please clarify?

Choose a reason for hiding this comment

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

Hi @petergmlui - I think the reviewers suggesting is based on style preference and possibly just alerting you to other ways to do this. :)

You can console out a number or a string. It depends on what you want your function to return.
Since .toFixed() returns a valid number as a string, you could convert the string value to a number, if you want.

Copy link
Author

Choose a reason for hiding this comment

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

@jenny-alexander Hi, thanks for your advice too, I have updated to use toFixed() and output a string at the same time I asked for clarification. If I am not mistaken about your advice, can you please mark this PR as complete?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 3, 2025
Used toFixed(1) to modify to one decimal per volunteer request (but it will now return a string instead of a number)
Copy link
Author

@petergmlui petergmlui left a comment

Choose a reason for hiding this comment

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

Updated 3-1-bmi.js


// round to 1 decimal place
bmi = (Math.round((bmi*10)))/10;

Copy link
Author

Choose a reason for hiding this comment

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

@LonMcGregor Thank you for your review! While I understand what you mean, using toFixed(1) is easier, but toFixed() returns a string, and round() returns a number. The instructions were not that clear about returning a string or a number, can you please clarify?

@petergmlui petergmlui added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jul 8, 2025
return bmi in number type
@petergmlui
Copy link
Author

@oluwatunmiisheii Wilson thank you for your help in class today! I have updated to return bmi in number type by using +. Have a great weekend!

@wilsonadenuga wilsonadenuga added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 12, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants