floatToString static method
Implementation
static String floatToString( double val, [int? width] ){
String str;
if( width == null ){
str = val.toStringAsPrecision( 6 );
} else {
if( width < 1 ){
width = 1;
}
if( width > 21 ){
width = 21;
}
str = val.toStringAsPrecision( width );
}
return _trimFloatStr( str );
}