-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Term Entry] Dart Type Conversion .toStringAsExponential() #4699
[Term Entry] Dart Type Conversion .toStringAsExponential() #4699
Conversation
Hey @Fejiro001! The first review is taken up by @cigar-galaxy82. Once he is done, will do the next review 😄 |
number.toStringAsExponential([int fractionDigits]) | ||
``` | ||
|
||
- `number`: an integer or double |
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.
- `number`: an integer or double | |
- `number`: An integer or a double. |
``` | ||
|
||
- `number`: an integer or double | ||
- `fractionDigits`: The number of digits to appear after the decimal point. If not specified, the default is as many digits as necessary. |
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.
Specify that fractionDigits is an integer and can range from 0 to 20
Hey @Fejiro001 Thank you for contributing to Codecademy Docs! I've suggested a few changes please modify Thank you! |
@cigar-galaxy82 what is the update on this? The author made the changes requested by you it seems, kindly check and update the status of this PR. Thanks! |
Hi @mamtawardhani changes have been made, the PR is ready for next review |
@cigar-galaxy82 please approve the pr |
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.
Hey @Fejiro001, thanks for contributing to the Codecademy Docs! The entry is nicely written.
I've suggested a few changes for the entry, could you please review and modify those at your earliest convenience? Thank you! 😄
--- | ||
Title: '.toStringAsExponential()' | ||
Description: 'Converts a number to its exponential notation in a string format.' | ||
Subjects: | ||
- 'Computer Science' | ||
- 'Mobile Development' | ||
- 'Code Foundations' | ||
Tags: | ||
- 'Dart' | ||
- 'String' | ||
- 'Method' | ||
CatalogContent: | ||
- 'learn-dart' | ||
- 'paths/computer-science' | ||
--- |
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.
--- | |
Title: '.toStringAsExponential()' | |
Description: 'Converts a number to its exponential notation in a string format.' | |
Subjects: | |
- 'Computer Science' | |
- 'Mobile Development' | |
- 'Code Foundations' | |
Tags: | |
- 'Dart' | |
- 'String' | |
- 'Method' | |
CatalogContent: | |
- 'learn-dart' | |
- 'paths/computer-science' | |
--- | |
--- | |
Title: '.toStringAsExponential()' | |
Description: 'Converts a number to its exponential notation in a string format.' | |
Subjects: | |
- 'Code Foundations' | |
- 'Computer Science' | |
- 'Mobile Development' | |
Tags: | |
- 'Dart' | |
- 'String' | |
- 'Method' | |
CatalogContent: | |
- 'learn-dart' | |
- 'paths/computer-science' | |
--- |
- 'paths/computer-science' | ||
--- | ||
|
||
The **`.toStringAsExponential()`** method is a Dart type conversion method that first converts a number to its exponential notation, then changes it to a string format. It can be used on integers and doubles. |
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.
The **`.toStringAsExponential()`** method is a Dart type conversion method that first converts a number to its exponential notation, then changes it to a string format. It can be used on integers and doubles. | |
The **`.toStringAsExponential()`** method in Dart is used for type conversion, converting a number to exponential notation and then converting it to a string format. It can be applied to both integers and doubles. |
- `number`: An integer or double | ||
- `fractionDigits`: An integer ranging from 0 to 20 that appears after the decimal point. If not specified, the default is as many digits as necessary. |
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.
- `number`: An integer or double | |
- `fractionDigits`: An integer ranging from 0 to 20 that appears after the decimal point. If not specified, the default is as many digits as necessary. | |
- `number`: This refers to a numeric value, either an integer or a double, on which the `.toStringAsExponential()` method is called. | |
- `fractionDigits`: An integer from 0 to 20 indicating the digits after the decimal point. If not specified, it defaults to as many digits as needed for accuracy. |
print("With fraction digits: ${result2}"); | ||
} | ||
``` | ||
`toStringAsExponential(5)` specifies that we want 5 digits after the decimal point. |
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.
`toStringAsExponential(5)` specifies that we want 5 digits after the decimal point. | |
This Dart example uses `.toStringAsExponential()` on a double to show both default and customized exponential notation with 5 fraction digits specified. This generates the following output: |
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.
Thanks for making the changes @Fejiro001! The entry is ready to be merged! 🚀
👋 @Fejiro001 🎉 Your contribution(s) can be seen here: https://www.codecademy.com/resources/docs/dart/type-conversion/toStringAsExponential Please note it may take a little while for changes to become visible. |
* added a new term entry for Dart Type Conversion * Update toStringAsExponential.md * Update toStringAsExponential.md * Update toStringAsExponential.md minor changes ---------
* added a new term entry for Dart Type Conversion * Update toStringAsExponential.md * Update toStringAsExponential.md * Update toStringAsExponential.md minor changes ---------
Description
Issue Solved
Type of Change
Checklist
main
branch.Issues Solved
section.