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

Java: Decimal places and other feature requests #180

Open
ghost opened this issue Sep 7, 2020 · 0 comments
Open

Java: Decimal places and other feature requests #180

ghost opened this issue Sep 7, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 7, 2020

Feature request to add a parameter that can control the number of decimal places returned. For example:

  • doubleToString( -0.331678f, 2 ) returns "-0.33".
  • doubleToString( -0.331678f, 5 ) returns "-0.33167".

Perhaps something like:

    index = min( index,
                 abs( index - (olength - (vplength + e10)) + decimals ) );
    return new String( result, 0, index );

Not sure about the feasibility of the next requests:

  • A version that always rounds (to remove the enum and eliminate the extra parameter).
  • A version without scientific notation (to eliminate a conditional statement).
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

No branches or pull requests

0 participants