How can in delphi convert :
'1' to '1,00'
or
'1,5' to '1,50'
e.g All variables are in string.
thank you
How can in delphi convert :
'1' to '1,00'
or
'1,5' to '1,50'
e.g All variables are in string.
thank you
You are looking for the formatFloat function i believe.
var
sText : string;
begin
sText := '1234';
showMessage(formatFloat('#,###.00', strToFloat(sText)));
-Don.
You can use Format or FormatFloat function. Format example (assuming ',' is decimal separator) is
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(Format('%.2f', [StrToFloat('1,5')]));
end;