Custom Number Field Decimal Places for Calculations

J

Jim Aksel

Using the Custom Number Field (Number1) in the Resouce View.
We use this field as a multiplier together with some other fields.

However, Project rounds this off to 2 decimal places which is producing
roundoff error for me. For example, if I want to multiply by 1.125 (1 +
1/8) then Project uses a value of 1.13.

How can I increase the number of displayed and used decimal places in Custom
Numbers to avoid rounding error?
 
J

JackD

Use a custom text field instead.
That way you won't get the rounding.
You can control the display using the format function.
Or use VBA and write the result to the custom field


-Jack Dahlgren
 
J

John

Jim Aksel said:
Using the Custom Number Field (Number1) in the Resouce View.
We use this field as a multiplier together with some other fields.

However, Project rounds this off to 2 decimal places which is producing
roundoff error for me. For example, if I want to multiply by 1.125 (1 +
1/8) then Project uses a value of 1.13.

How can I increase the number of displayed and used decimal places in Custom
Numbers to avoid rounding error?

Jim,
Basically you can't. I believe the number is actually stored in
Project's underlying database exactly as you entered it but it is only
displayed in number fields to two decimal places. However, you can use a
spare text field to enter (and display) numerical values to however many
decimal places you need. You should also then use a text field to
display the result.

Hope this helps.
John
Project MVP
 
J

Jim Aksel

To close this out, I did a test in a Project1.mpp file using Text1, Text2,
Number1, Number2. The number fields round to 2 decimal places. For example,
enter 0.125 into Number1, use a formula as Number2=10*[Number1] and it shows
0.13 and 1.3 respectively. Text2=10*[Number1] also shows 1.3 so there is no
more precision than what is displayed.

Using the text fields, I can obtain what I need --- Text1=0.125,
Text2=10*[Text1] shows 1.25 and the world is content. So, the solution
becomes to use Text fields instead of Number fields if more than 2 decimals
are necessary.

If anyone else has another solution, please let us know
 
J

John

Jim Aksel said:
To close this out, I did a test in a Project1.mpp file using Text1, Text2,
Number1, Number2. The number fields round to 2 decimal places. For example,
enter 0.125 into Number1, use a formula as Number2=10*[Number1] and it shows
0.13 and 1.3 respectively. Text2=10*[Number1] also shows 1.3 so there is no
more precision than what is displayed.

Using the text fields, I can obtain what I need --- Text1=0.125,
Text2=10*[Text1] shows 1.25 and the world is content. So, the solution
becomes to use Text fields instead of Number fields if more than 2 decimals
are necessary.

If anyone else has another solution, please let us know

Jim,
I did a little test of my own and I stand corrected. Apparently number
fields are stored and displayed rounded to 2 decimal places.

So what's wrong with the text field approach? It works, you're done.
What else are you looking for?

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top