Design comparison
Solution retrospective
Built with
- ReactJS
- Typescript
- Semantic HTML5 markup
- Flexbox
Let me know if you have any recommendations 🙏🏻
Community feedback
- @vovka8101Posted 9 months ago
Hi, congratulations on completing this challenge! But I noticed a little bug which is associated with JavaScript... For example if I want to calculate 2.3 - 1, I'll get 1.2999999... instead of 1.3. So, to fix that problem you can use: parseFloat(result.toFixed(4)). By using this approach you'll get numbers with maximum of 4 decimal places. Now 2.3 - 1 = 1.3; 2.333 - 1 = 1.333.
1@petritnurediniPosted 9 months ago@vovka8101 Thank you for your feedback. I have fixed that bug now. I managed to fix that by checking first if result is integer or not. If the result is not integer I am using toFixed(3) function.
Best regards.
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord