Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too many decimals displayed

Status
Not open for further replies.

dt2demar

Technical User
Nov 20, 2000
32
CA

I'm displaying data using a listbox on a form. However it's displaying 12 digits of decimals which is unecessary.

I notice that the number of decimal places can be specified when using a combobox properties. How can I do the same for a listbox?

thanks,
 
One way is t use the format function. Check HELP for the arguments.


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 

I did a search for 'format function' and I found the following (see below). I'm now sure how I can use this though? I tried putting it into the query field that calculates the data, but it gives me an error. Any help would be appreciated.

FIXED
Rounds a number to the specified number of decimals, formats the number in decimal format using a period and commas, and returns the result as text.

Syntax

FIXED(number,decimals,no_commas)

Number is the number you want to round and convert to text.

Decimals is the number of digits to the right of the decimal point.

No_commas is a logical value that, if TRUE, prevents FIXED from including commas in the returned text. If no_commas is FALSE or omitted, then the returned text includes commas as usual.

Numbers can never have more than 15 significant digits, but decimals can be as large as 127.


If decimals is negative, number is rounded to the left of the decimal point.


If you omit decimals, it is assumed to be 2.
 
The usage of the format command is like so:

format([DataToFormat],"How you want it formatted")

So if you wanted to do two decimals (there are other ways to format this, this is only one!!)

format([DataToFormat],"0.00")

Hope that helps!
Joe Miller
joe.miller@flotech.net
 
Yes. That solves my problem. Thank-you very much.

This website is awesome!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top