Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Como poner separador de miles en un label01.caption? (https://www.clubdelphi.com/foros/showthread.php?t=76818)

negrokau 29-11-2011 11:44:43

Como poner separador de miles en un label01.caption?
 
hola a todos, no se si es una sonsera, pero no se como ponerle un separdor de miles al caption de un label... les agradeceria mucho la ayuda, muchas gracias por adelantado...

olbeup 29-11-2011 11:50:03

Prueba con esto:
Código Delphi [-]
Label1.Caption := FormatFloat('#,#0', Valor);
Un saludo.

negrokau 29-11-2011 12:09:33

muchas gracias... me fue de gran ayuda

Al González 29-11-2011 16:00:57

Como dato adicional, decir que es suficiente con que el formato lleve una coma:
Código Delphi [-]
Label1.Caption := FormatFloat (',0', Valor);
Cita:

Empezado por Tema "FormatFloat function" de la ayuda
, Thousand separator. If the format string contains one or more ',' characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of ',' characters in the format string does not affect the output, except to indicate that thousand separators are wanted. The actual character used as a the thousand separator in the output is determined by the ThousandSeparator global variable or its TFormatSettings equivalent.

Saludos. :)

Al González.

olbeup 29-11-2011 19:05:08

Siempre se aprende algo más

+1

Un saludo.


La franja horaria es GMT +2. Ahora son las 23:26:38.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi