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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

decimals are dropping during calculation 1

Status
Not open for further replies.

DLynnTX

IS-IT--Management
Dec 9, 2004
67
US
I have a several numeric fields and a text field that I am using in a calculation in a query to join together as a "product description". However, even though the numeric fields are set to show 3 decimal places and I have tried using the "Round" function in the calculation, the ending zeros are dropped. What am I doing wrong? I even tried converting it to text first - zeros still dropped.
 
Go back to the table, look at the field properties and change the Field Size to single or double. I think your numbers will behave.

Cheers,
Bill
 
Both fields are already set to Double, Fixed and 3.
 
Well, since you have already covered the less obvious culprit, I'll go back to the more obvious ones for the sake of being thorough.

But first, try entering data directly into the table and see what happens. If the data retains the appropriate format, then you know your problem lies further upstream.

1. Check the control's format property
2. Drop the Round function. This should either be redundant or is part of the problem
3. Check you code to see if the data is being formatted. Particularly look at the control's Before and After update events and the form's Before update event.
4. For grins, have a look at any formatting on the form's recordsource. Fields can be formatted at the query level although this usually gets overridden somewhere else.

Cheers,
Bill
 


Hi,

Am I missing something?

You want to convert a floating point to text with 3 decimal places?
Code:
Format(YourFloatingPtNbr, "00000.000")


Skip,

[glasses] [red]Be Advised![/red] The only distinction between a bird with one wing and a bird with two, is merely...
a difference of A Pinion! [tongue]
 
formerTexan, I'm looking at all of these - The data does enter correctly in the table and the control's format property is right. I dropped the round function - no change. That's as far as I've gotten so far...

Skip, that actually worked, except that I don't want leading 0's - and the number is either one or two digits before the decimal. I tried [0]0.000 but that didn't work. Any suggestions?

Thank you both for your responses.
 
Skip - I just did ".000" and it does what it needs to to the digits ahead of the decimal. I will try this with the entire formula and let you know if it works. Thank you.
 
Skip - that worked perfectly! Thank you. The only other thing that would make it perfect for management is if I could convert the first number from decimal to fraction - but he says he can live with it the way it is. Thank you again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top