23-08-2012, 12:23 PM
كود :
Example code : Display numbers as financial values
var
amount1 : Extended;
begin
amount1 := 1234.567;
// Display in a Currency format
CurrencyString := '? ';
ShowMessage('Using 8,4 = '+FloatToStrF(amount1, ffCurrency, 8, 4));
ShowMessage('Using 4,4 = '+FloatToStrF(amount1, ffCurrency, 4, 4));
ShowMessage('Using 4,2 = '+FloatToStrF(amount1, ffCurrency, 4, 2));
ShowMessage('Using 2,4 = '+FloatToStrF(amount1, ffCurrency, 2, 4));
end;/////Result
كود :
Using 8,4 = ? 1,234.5670
Using 4,4 = ? 1,235.0000
Using 4,2 = ? 1,235.00
Using 2,4 = 1.2E0003
