Hello,
I am stuck on task 1069, I was only able to implement solutions 1-4. I looked at the forum for guidance and I was nowhere close to the solution, and I can't follow most of the code or comprehend the why and how behind it.
I do not want to copy code without understanding "the why" behind the approach. Obviously, I am not asking myself or google the right questions.
What questions could I ask myself to put myself on the right path? Can you suggest a problem-solving method/approach that I can use to better understand what I am trying to accomplish and implement a mind map to get there?
I really need this for my development, because I do not have a technical background and learning on my own is very challenging.
// Code below for solutions 1-4.
export const formatNumber = (n) => {
if (n < 1000) {
return n.toFixed(1);
} else if (n < 1000000) {
return (n / 1000).toFixed(2) + 'K';
} else if (n < 1000000000) {
return (n / 1000000).toFixed(2) + 'M';
} else if (n < 1000000000000) {
return (n / 1000000000).toFixed(2) + 'B';
} else if (n < 1000000000000000) {
return console.log((n / 1000000000000).toFixed(2) + 'T');
}
};