[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bump::msaccess

Title:MSACCESS
Moderator:BUMP::HONER
Created:Tue Dec 01 1992
Last Modified:Mon Jun 02 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1661
Total number of notes:6339

1210.0. "Retaining only 2 decimal places" by DYOSW5::WILDER (Does virtual reality get swapped?) Wed Jul 05 1995 15:21

T.RTitleUserPersonal
Name
DateLines
1210.1Solved it in the KBDYOSW5::WILDERDoes virtual reality get swapped?Wed Jul 05 1995 17:594
1210.2guarantee 2 decimal places??DYOSW5::WILDERDoes virtual reality get swapped?Mon Feb 10 1997 09:2613
    Well, I need to revisit this. 
    
    While doing the rounding/truncation, I sometimes lose the right most
    digit if it is a zero. For example, rounding 73.40334 yields 73.4, NOT
    73.40
    
    I need to get in this case, 73.40, or at least ALWAYS guarantee that
    there is 2 decimal places. Is there some way to do this?
    
    Thanks,
    
    /jim
    
1210.3NSIC00::KLERKThunderbirds are GoMon Feb 10 1997 12:225
 Doesn't the output format property allow you to specify "2 decimal places,
 use zero where needed" requirement?

 Theo
1210.4Stores differently than displayDYOSW5::WILDERDoes virtual reality get swapped?Tue Feb 11 1997 19:5512
    re: .3
    
    Well, for display/printing, the output format will work. However, it
    actually stores it as 73.4  not  73.40. I need the 73.40 number for
    string manipulation. (I am storing time and need hundredths of a second
    and MSaccess does not understand time to this granularity). Is it
    possible to force Access to keep both digits when storing the number??
    
    Thanks,
    
    /jim
    
1210.5Format seems the way to goNSIC00::KLERKThunderbirds are GoWed Feb 12 1997 04:0824
  Making a table with a column of type Currency and it displays 2 digits
  always, regardless if I want to enter or modify a number.

  For string manipulation you can of course use the Format$ routine to
  format any value in the way you want it. For example, if [number] is any
  currency (or float) number, Format([number],"0.00") will always return
  a string of 2 digits behind the decimal point (both 00 if needed) and
  at least one in front of it.

  You can try out various Formats till you see one you like by making
  a query based on the table containing the numbers. Add that number column
  to the grid, and then add a non-column entry in the next grid entry
  with:

  field:       number             formatted:Format([number],"00.0000")
  table:       Table1
  show:         x                      x
  

  where [number] is the column name of the number field, the "00.0000" is
  the format you want to display, "Format" is the function name and
  "formatted" is simply the heading of the query column when you run the
  query.