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

Enhancement: Add support for custom minus sign in toFormat method #289

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

skynightz
Copy link

It would be great to be able to specify a string or a character to customize negative sign of a value. It's using the character "hypen minus" (decimal code: 45) in your code and we want to use the "minus sign" (decimal code: 8722) instead.

@Skywalker13
Copy link

ping.. please

@MikeMcl
Copy link
Owner

MikeMcl commented May 9, 2021

It's reasonable but the changes to the behaviour of toString would break creating a BigNumber from a BigNumber's toString value, which is unacceptable.

@skynightz
Copy link
Author

skynightz commented May 10, 2021

I modified also the toString method because it was used in toFormat for the "-Infinity" case. it wasn't formating the string in this case. I can modify my PR to change only the toFormat method.

@skynightz
Copy link
Author

I reverted my changes in toString method and handle the case for negative infinity in toFormat method.

@MikeMcl
Copy link
Owner

MikeMcl commented May 10, 2021

Okay, I'll take a look presently.

@skynightz skynightz changed the title Enhancement: Add support for custom minus sign in toFormat and toString method Enhancement: Add support for custom minus sign in toFormat method May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants