This doesnt work,,,,it must be my syntax....can anyone help?
What about :
var
FloatValue, FloatResult: Double;
begin
FloatResult := FormatFloat('###,##0.00', FloatValue);
end;
FloatToDecimal is normally called only inside complex formatting routines;
it handles the basic float-to-char conversion. To do that, it uses a special
return record format has its first parameter. The above code is not at all
what's needed (the third param is wrong too). But, more important, whatever
it is you're trying to do, FloatToDecimal isn't going to do it.
Could it be that all you want is —
myCurrency := myDouble;
where myCurrency is of type Currency and myDouble of any ordinary float
type, e.g. Double?
PhR
Var
FloatVal:TFloatRec; // <<<< TFloatRec not Double
DecVal:Currency;
Begin
FloatToDecimal(FloatVal,DecVal,fvCurrency,18,2); // fvCurrency as param not
Currency
end;
Check help on TFloatRec and TFloatValue to find out more about the proper
parameter data types that must be given to FloatToDecimal.
Respectfully yours,
graham
Les Piotrowski wrote in message <74oh3s$e0...@forums.borland.com>...
>Im trying to convert a float to decimal (currency) but am having problems
>with the syntax,
>Var
>FloatVal:Double;
>DecVal:Currency;
>Begin
>FloatToDecimal (FloatVal,DecVal,Currency,18,2);
>End;
>