Wortz, Charles
CWortz at tea.state.tx.us
Wed Apr 9 07:32:20 CDT 2003
Barb,
If I understand you correctly you are trying to display a numeric field
with one of three different formats depending on the value. AFAIK this
is not possible directly. The only solution I know of is to test the
numeric value and then convert it to the proper string value for
display.
If number = 0 then
txtnumber = ""
elseif number = Int(number) then
txtnumber = format(number,99)
else
txtnumber = format(number,99.99)
endif
Warning above is air code, no guarantees.
Charles Wortz
Software Development Division
Texas Education Agency
1701 N. Congress Ave
Austin, TX 78701-1494
512-463-9493
CWortz at tea.state.tx.us
-----Original Message-----
From: Barbara Ryan [mailto:BarbaraRyan at cox.net]
Sent: Wednesday 2003 Apr 09 06:57
To: Access List
Subject: [AccessD] Format for decimal
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??
Thanks,
Barb Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030409/2d6e5d06/attachment-0001.html>