Board index » delphi » Specifying decimal places for field display

Specifying decimal places for field display

Hope someone can help me here,

I need to display certain fields from a table with a specified
number of decimal places.  It seems I have to set the DisplayFormat
property of the TField object, but I don't know to what.

Can anyone help?

Thanks in advance,

Steven Hovington

 

Re:Specifying decimal places for field display


In article <01bd8ee7$80d9f840$6796a8c0@stevewin95>, "Steven H."

Quote
<steve.hoving...@datacore.demon.co.uk> writes:
>I need to display certain fields from a table with a specified
>number of decimal places.  It seems I have to set the DisplayFormat
>property of the TField object, but I don't know to what.

This is the (fairly standard) windows type formatting (as in Excel for
instance) -

Using 0 to mean zero or a data digit, # to mean a data digit (zero is space),
and any other to be a liters.

So $#0.00 would give a normal dollar currency - $1234.89 or $0.89 or $4.00 (my
aol browser won't take the pounds stg sign). The format iscan be up to three
sets separated by a semi-colon for +ve, -ve, and zero values -
$#0.00;($#0.00);None gives $34.89 for that +ve amount ($34.89 for that -ve
amount and "None" for zero.

Date formats do not use the three sets and semi-colons (not appropriate) but
use y, m, d, h, n, s for year, month, day, hour, minute, and seconds. with :-

d meaning 1 or 12
dd meaning 01 or 12
ddd meaning Mon, Tue,
dddd meaning Monday, Tuesday - same for months. Hours minutes and seconds use
the single or double characters only (and I think .ss for decimal seconds).

Alan Lloyd
alangll...@aol.com

Other Threads