public static int formatScientific(float v,
                                       StringBuffer buf,
                                       int maxDigits, int exponentMultiple,
                                       int roundMode,
                                       int minWholeDigits, int minFractDigits,
                                       char minusSymbol, char plusSymbol,
                                       char decimalSeparator, int decimalScale,
                                       char groupingSeparator,
                                       int groupingWidth,
                                       String infinity, String nan)
    {
        if (formatSpecials(v, buf, minWholeDigits, minFractDigits,
                           minusSymbol, plusSymbol, decimalSeparator,
                           infinity, nan)) {
            return 0;
        }

        char[] digits = new char[Math.min(10, maxDigits) + 1];
        int result = toDecimalDigits(v, digits, 0, maxDigits, 100, roundMode);
        
        return formatScientificResult(digits, result, buf, exponentMultiple,
                                      minWholeDigits, minFractDigits,
                                      decimalSeparator, decimalScale,
                                      groupingSeparator, groupingWidth);
    }
public static int formatScientific ( float v , StringBuffer buf , int maxDigits , int exponentMultiple , int roundMode , int minWholeDigits , int minFractDigits , char minusSymbol , char plusSymbol , char decimalSeparator , int decimalScale , char groupingSeparator , int groupingWidth , String infinity , String nan ) { if ( formatSpecials ( v , buf , minWholeDigits , minFractDigits , minusSymbol , plusSymbol , decimalSeparator , infinity , nan ) ) { return 0 ; } char [ ] digits = new char [ Math . min ( 10 , maxDigits ) + 1 ] ; int result = toDecimalDigits ( v , digits , 0 , maxDigits , 100 , roundMode ) ; return formatScientificResult ( digits , result , buf , exponentMultiple , minWholeDigits , minFractDigits , decimalSeparator , decimalScale , groupingSeparator , groupingWidth ) ; }
@param v value
@param buf buffer to receive formatted number
@param maxDigits maximum number of manstissa digits to produce
@param exponentMultiple when > 1, decimal exponent is adjusted to be
a multiple of this; i.e. use 3 for engineering notation
@param roundMode i.e. ROUND_HALF_UP
@param minWholeDigits minimum number of whole digits to produce
@param minFractDigits minimum number of fractional digits to produce
@param minusSymbol i.e. '-' or '\uffff' for none
@param plusSymbol i.e. '+' or '\uffff' for none
@param decimalSeparator i.e. '.'
@param decimalScale i.e. 0 for none or 2 for percentages
@param groupingSeparator i.e. ',' or '\uffff' for none
@param groupingWidth i.e. 3 or 0 for none
@param infinity i.e. "Infinity" or "\u221e"
@param nan i.e. "NaN" or "\ufffd"
@return decimal exponent