Re: Optimized float to string library




"Dave White" wrote
> Two parameters, a double value and an integer number of
> significant figures, with the result returned as a string
> function FormatSigFigs(value : double; sf : integer) : string;

Dave, Just to confirm a few guesses:
By number of significant figures do you really mean that or the
number of decimal fraction digits?
Are the following examples correct?
FormatSigFigs(1.0 ,1) = '1'
FormatSigFigs(1.0 ,2) = '1.0'
FormatSigFigs(1.2345 ,4) = '1.234'
FormatSigFigs(12345.0 ,5) = '12345'
FormatSigFigs(-12345.0 ,5) = '-12345'
FormatSigFigs(12345.0 ,4) = '12340'
What decimal place do you want to use?
What rounding method do you want to use?
What thousands separator do you want to use?
Regards, JohnH
.