-
Notifications
You must be signed in to change notification settings - Fork 15
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
Implement DecimalNotationFormatter and associated tests #36
Conversation
Description: - Added a new DecimalFractionFormatter class for formatting Fraction objects into decimal string representations. - Created tests for the DecimalFractionFormatter in the DecimalFractionFromatter_Format method to ensure correct functionality.
That's pretty cool. I wish this article from Microsoft had existed years ago (or it hadn't been so well hidden). Then I would have used it as a guide for the I find this extension very useful. Unit tests are always valuable and necessary. However, this class would at least have to be mentioned and documented in the README.md. 😄 |
Just a couple of points to clear up:
|
As I wrote before - I find this formatter pretty cool and useful. My current implementation can only output decimal numbers in the representable range of the |
If I haven't said it yet: thank you for your commitment and dedication. I really appreciate that. |
- implemented the precise version of the percent format ("P")
…ev/Fractions into decimal-quantity-formatter
- adjusted the variable names to match the project config - updated the comments
- refactored the tests into separate classes
- added the remaining tests - updated the readme section
…lent ToDouble().ToString(...)
Description:
DecimalNotationFormatter
class for formatting Fraction objects into decimal string representations corresponding to the Standard numeric format strings.DecimalNotationFormatter
in theDecimalNotationFormatter_Format
Here are the supported format options (with unlimited precision):
double
(maintaining interoperability at the cost of precision)DecimalNotationFormatter
ToDouble().ToString(...)