[AccessD] Format for decimal

Gustav Brock gustav at cactus.dk
Wed Apr 9 07:45:51 CDT 2003


Hi Barbara

> I am displaying several "hours worked" fields on a report (which contains 2 decimal positions).  If hours worked is a whole number, I do NOT want to display any decimal positions (e.g. "8"); if
> hours worked is 0, I do not want to display anything (i.e., leave the field blank/null); it hours worked contains decimals, I want to display the decimals (e.g., "8.25").

> If I set up the format as "##.##", the decimal point is displayed when hours worked is a whole number (e.g., "8.")  How do I get rid of that pesky decimal point??

If you only have positive counts you can cheat and adjust your source
as this:

  =IIf(Int([HWorked])=[HWorked];[HWorked];-[HWorked])

which will display a negative count for decimal hours.

Now, adjust your format string to this:

  0;0.00;""

which will leave blanks for zero hours count.

/gustav



More information about the AccessD mailing list