Skip to content

Develop#2186

Open
GabrielSpelchuk wants to merge 3 commits intomate-academy:masterfrom
GabrielSpelchuk:develop
Open

Develop#2186
GabrielSpelchuk wants to merge 3 commits intomate-academy:masterfrom
GabrielSpelchuk:develop

Conversation

@GabrielSpelchuk
Copy link

Copy link

@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

Great work on implementing the core logic to parse the data and calculate the total and average population! The calculations themselves are correct.

However, this requires a change because a key requirement from the task description has been missed. The final calculated numbers for both the total and average population must be formatted with a thousands separator to match the style of the original data (e.g., 4,367,332,219 instead of 4367332219).

You might find the number.toLocaleString() method useful for this. Please apply this formatting to your results before setting the textContent of the elements.


✨ 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

const totalPopulationElement = document.querySelector('span.total-population');
const avgPopulationElement = document.querySelector('span.average-population');

totalPopulationElement.textContent = totalPopulation;

Choose a reason for hiding this comment

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

The task requires the final number to be formatted with a thousands separator (e.g., '1,234,567'). Currently, the raw number is being assigned. You might find the toLocaleString() method helpful for number formatting.

const avgPopulationElement = document.querySelector('span.average-population');

totalPopulationElement.textContent = totalPopulation;
avgPopulationElement.textContent = Math.round(averagePopulation);

Choose a reason for hiding this comment

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

Just like the total population, the average population also needs to be formatted with a thousands separator. Make sure to apply the formatting after rounding the value.

Copy link

@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! I am approving this pull request. You've successfully addressed the feedback from the previous review by adding the thousands separator formatting using toLocaleString. The code now correctly meets all the requirements of the task. 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

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.

2 participants