-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use powers of ten for large numbers #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ This pull request was sent to the PullRequest network.
Check the status or cancel PullRequest code review here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PullRequest Breakdown
Reviewable lines of change
+ 27
- 8
89% TSX
11% Jest Snapshot (tests)
Type of change
Minor Update - These changes appear to be a minor update to existing functionality and features.
Build succeeded and deployed at https://bristemouth-ui-17.surge.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a suggestion for you on how to avoid injecting html in your exponent string and then having to use dangerouslySetInnerHTML to render it.
Reviewed with ❤️ by PullRequest
return ( | ||
<span> | ||
{exponentialForm.replace(/e[+-](\d+)/, ' x 10')} | ||
<sup>{digits}</sup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here digits should never be empty, since the regex should always match something for a number in exponential notation. Added some checks in line :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of exponential notation: