Skip to content

solution#2237

Open
Kit3AWP wants to merge 2 commits intomate-academy:masterfrom
Kit3AWP:develop
Open

solution#2237
Kit3AWP wants to merge 2 commits intomate-academy:masterfrom
Kit3AWP:develop

Conversation

@Kit3AWP
Copy link
Copy Markdown

@Kit3AWP Kit3AWP commented Apr 7, 2026

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Excellent work on implementing the core logic to fetch the data and perform the calculations! Your code is clean and works well.

There is one small adjustment needed to meet the task's styling requirements. The calculated average population is currently being displayed with decimal places, but the task requires it to have the 'same numeric style as populations presented,' which are all whole numbers.

To fix this, please round the average value to the nearest whole number before you format it using toLocaleString(). The Math.round() function would be a great choice for this. After that small change, your solution will be perfect!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/scripts/main.js
}, 0);
const average = total / populationNumbers.length;
const totalFormatted = total.toLocaleString();
const averageFormatted = average.toLocaleString();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The task requires the calculated numbers to have the 'same numeric style as populations presented'. The presented populations are whole numbers. When you calculate the average, it's likely to be a floating-point number (e.g., 12345.67). Using toLocaleString() directly on this will result in a formatted string with decimals (e.g., "12,345.67"), which doesn't match the style of the other population figures.

Consider rounding the average to the nearest whole number before formatting it. Math.round() would be a good function to use for this.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Excellent work addressing the feedback from the previous review! Rounding the average population was the final piece needed, and now the output perfectly matches the required numeric style. The code is clean, functional, and all task requirements are fully met. I'm happy to approve your solution. Great job!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Copy link
Copy Markdown

@brespect brespect left a comment

Choose a reason for hiding this comment

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

Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants