Skip to content
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

Merged
merged 9 commits into from
Jun 12, 2024

Conversation

Fejiro001
Copy link
Contributor

Description

Issue Solved

Type of Change

  • Adding a new entry
  • Updating the documentation

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • I have linked any issues that are relevant to this PR in the Issues Solved section.

@cigar-galaxy82 cigar-galaxy82 self-assigned this May 25, 2024
@cigar-galaxy82 cigar-galaxy82 added new entry New entry or entries status: under review Issue or PR is currently being reviewed dart Dart entries labels May 26, 2024
@Fejiro001
Copy link
Contributor Author

@mamtawardhani

@mamtawardhani
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- `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.
Copy link
Collaborator

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

@cigar-galaxy82
Copy link
Collaborator

Hey @Fejiro001

Thank you for contributing to Codecademy Docs!

I've suggested a few changes please modify

Thank you!

@cigar-galaxy82 cigar-galaxy82 removed status: waiting for author status: under review Issue or PR is currently being reviewed labels Jun 4, 2024
@ishg-153 ishg-153 linked an issue Jun 5, 2024 that may be closed by this pull request
3 tasks
@mamtawardhani
Copy link
Collaborator

@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!

@cigar-galaxy82
Copy link
Collaborator

Hi @mamtawardhani changes have been made, the PR is ready for next review

@mamtawardhani mamtawardhani added status: under review Issue or PR is currently being reviewed and removed status: ready for next review labels Jun 10, 2024
@mamtawardhani mamtawardhani self-assigned this Jun 10, 2024
@mamtawardhani
Copy link
Collaborator

@cigar-galaxy82 please approve the pr

Copy link
Collaborator

@mamtawardhani mamtawardhani left a 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! 😄

Comment on lines 1 to 15
---
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'
---
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
---
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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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.

Comment on lines 25 to 26
- `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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- `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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
`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:

Copy link
Collaborator

@mamtawardhani mamtawardhani left a 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! 🚀

@mamtawardhani mamtawardhani merged commit 8e462b2 into Codecademy:main Jun 12, 2024
6 checks passed
Copy link

👋 @Fejiro001
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!

🎉 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.
If you're appearing as anonymous and want to be credited, see here.

letsbuildanything pushed a commit that referenced this pull request Jun 14, 2024
* added a new term entry for Dart Type Conversion

* Update toStringAsExponential.md

* Update toStringAsExponential.md

* Update toStringAsExponential.md

minor changes

---------
letsbuildanything pushed a commit that referenced this pull request Jun 14, 2024
* added a new term entry for Dart Type Conversion

* Update toStringAsExponential.md

* Update toStringAsExponential.md

* Update toStringAsExponential.md

minor changes

---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Term Entry] Dart Type Conversion .toStringAsExponential()
4 participants