[AccessD] Format for decimal

Barbara Ryan BarbaraRyan at cox.net
Wed Apr 9 07:48:27 CDT 2003


MessageThanks, Charles....I'll give it a try................Barb
  ----- Original Message ----- 
  From: Wortz, Charles 
  To: accessd at databaseadvisors.com 
  Sent: Wednesday, April 09, 2003 8:32 AM
  Subject: RE: [AccessD] Format for decimal


  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


------------------------------------------------------------------------------


  _______________________________________________
  AccessD mailing list
  AccessD at databaseadvisors.com
  http://databaseadvisors.com/mailman/listinfo/accessd
  Website: http://www.databaseadvisors.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030409/3c94692e/attachment-0001.html>


More information about the AccessD mailing list