nUMBER rOUNDING (1 Viewer)

dogman01

Registered User.
Local time
Today, 02:04
Joined
Dec 3, 2008
Messages
47
On a number field whose format is "fixed" and decimal is "Auto" how do you stop the results from automatically rounding. I need exactly what is typed into the field to stay and not round itself. Thanks
 

DevastatioN

Registered User.
Local time
Today, 03:04
Joined
Nov 21, 2007
Messages
242
You can use a General Number with Auto, and it seems to keep any amount of decimals that the user enters.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 07:04
Joined
Sep 12, 2006
Messages
15,729
if the format is fixed, you are saying you want a limited number of significant decimals (ie rounded by definition)- you cant have both fixed and non-fixed at the same time
 

missinglinq

AWF VIP
Local time
Today, 02:04
Joined
Jun 20, 2003
Messages
6,420
Also, just to be sure; you're not trying to store numbers with decimals in a numeric field defined as an Integer are you? Access will always round this to a whole number.
 

Atomic Shrimp

Humanoid lifeform
Local time
Today, 07:04
Joined
Jun 16, 2000
Messages
1,954
Or are you saying you want trailing zeroes to be preserved? (i.e. 6.20 doesn't turn to 6.2)
 

Brianwarnock

Retired
Local time
Today, 07:04
Joined
Jun 2, 2003
Messages
12,701
I think what Dogman01 is saying is that if somebody types 3.237 in the form's control then it becomes 3.24 and he/she wants 3.23. If so

In the control's after update event code

Me.yourcontrolname= me.yourcontrolname - 0.005


Brian
 

Rabbie

Super Moderator
Local time
Today, 07:04
Joined
Jul 10, 2007
Messages
5,906
On a number field whose format is "fixed" and decimal is "Auto" how do you stop the results from automatically rounding. I need exactly what is typed into the field to stay and not round itself. Thanks
I think what Dogman01 actually wants is the exact number to displa as typed in - no rounding. So if the user types in 3.237 that's what should show
 

Brianwarnock

Retired
Local time
Today, 07:04
Joined
Jun 2, 2003
Messages
12,701
I think what Dogman01 actually wants is the exact number to displa as typed in - no rounding. So if the user types in 3.237 that's what should show

Surely not, he would realise that he cannot use fixed and have variable length data.

Brian
 

Rabbie

Super Moderator
Local time
Today, 07:04
Joined
Jul 10, 2007
Messages
5,906
Surely not, he would realise that he cannot use fixed and have variable length data.

Brian
Brian, I would hope so but he does seem very clear in what he thinks he wants. It hasn't helped that he so far hasn't replied to any of the requests for clarification
 

Brianwarnock

Retired
Local time
Today, 07:04
Joined
Jun 2, 2003
Messages
12,701
Brian, I would hope so but he does seem very clear in what he thinks he wants. It hasn't helped that he so far hasn't replied to any of the requests for clarification

Rabbie, I have just checked his profile and he was on when DevastatioN replied , so maybe he realised his error and is keeping a low profile.
We all make mistakes its to be hoped that he explains even if he is embarrassed.

Brian
 

Rabbie

Super Moderator
Local time
Today, 07:04
Joined
Jul 10, 2007
Messages
5,906
Rabbie, I have just checked his profile and he was on when DevastatioN replied , so maybe he realised his error and is keeping a low profile.
We all make mistakes its to be hoped that he explains even if he is embarrassed.

Brian
Show me a person who hasn't made a mistake and I'll show you someone who hasn't done anything. Mistakes are how we learn:)
 

mafhobb

Registered User.
Local time
Today, 01:04
Joined
Feb 28, 2006
Messages
1,245
I am having a similar (exact) problem. I have one table with a form associated to it. This table has a "Quantity", a "Cost" and an "Extended Cost". The data format is "General number", 2dec places, then "Currency", then "Currency".

I have two ways if entering the quantity. One is through another form (Iam still trying to figure that out) and the second one is directly in the main form.

In any of the cases, when I enter a number (say 4.6) in the "quantity" field, the number that shows in the field is 5 (it is getting rounded off), but the calculation (Quantity*Cost=Extended Cost) is using 4.5...

So, why is it getting rounded off? I do not what that!!!!

mafhobb
 

Attachments

  • db2.zip
    28.4 KB · Views: 111

mafhobb

Registered User.
Local time
Today, 01:04
Joined
Feb 28, 2006
Messages
1,245
got it. i needed to set the table field to "double" and the form field to "standard" that fixed it.
 

Users who are viewing this thread

Top Bottom