Tema: Decimales.
Ver Mensaje Individual
  #4  
Antiguo 22-03-2009
Avatar de Delphius
[Delphius] Delphius is offline
Miembro Premium
 
Registrado: jul 2004
Ubicación: Salta, Argentina
Posts: 5.582
Reputación: 25
Delphius Va camino a la fama
Cita:
Empezado por Iron Ver Mensaje
Hola Delphius,
Gracias por contestar, lo intenté con format como en Visual pero me da error.
Delphi no es Visual Basic. Por algo he dicho: leer la ayuda:
Cita:
Returns a formatted string assembled from a format string and an array of arguments.

Unit

SysUtils

Category

string formatting routines

function Format(const Format: string; const Args: array of const): string;

Description

This function formats the series of arguments in the open array Args. Formatting is controlled by the format string Format; the results are returned in the function result as a string.

For information on the format strings, see Format Strings.
Lee sobre Format Strings.

Un ejemplo de uso:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage(format('%.2f',[132.457843]))
end;

Y si te da error es conveniente que nos comentes textualmente que error para saber como ayudarte. Me gustaría ver una muestra de cómo lo intentaste usar...

Saludos,
__________________
Delphius
[Guia de estilo][Buscar]
Responder Con Cita