ryu
ryu copied to clipboard
Java: Decimal places and other feature requests
trafficstars
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
enumand eliminate the extra parameter). - A version without scientific notation (to eliminate a conditional statement).