floatToExponential static method

String floatToExponential(
  1. double val, [
  2. int? width
])

Implementation

static String floatToExponential( double val, [int? width] ){
	String str;
	if( width == null ){
		str = val.toStringAsExponential();
	} else {
		if( width < 0 ){
			width = 0;
		}
		if( width > 20 ){
			width = 20;
		}
		str = val.toStringAsExponential( width );
	}
	return _trimFloatStr( str );
}