Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- Creo Parametric
- :
- Part Modeling
- :
- Round up values in drawing table - calculating iss...

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-24-2020
03:04 AM

08-24-2020
03:04 AM

Hi,

an issue here with calculated values in a drawing table (please see attached picture).

Using more digits after the comma is not an option.

If instead floor a ceil option is used the the wrong value goes correct, but the rest of the values for the total weight goes wrong.

Is there a way to have all values correctly calculated.

Thank you in advance.

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-24-2020
07:17 AM

08-24-2020
07:17 AM

Without seeing the actual numbers involved, I'm guessing what you want is:

(1) The unit mass is a rounded value, displayed using something like MASS[.2]. When this type of display is done, it rounds the number up/down depending on the rest of the digits.

(2) You want the total mass to be calculated as the total quantity (parts + spares) times this rounded value.

Trouble is, floor doesn't give you the rounded value, it just chops off the remainder of the decimal places, more a text operation than a mathematical one. The "trick" is to make the floor operation act like a rounding function by adding the appropriate half value. So, instead of **floor(mass,2)**, you can use **floor((mass+0.005),2)**. That will effectively "round up" when appropriate.

6 REPLIES 6

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-24-2020
03:47 AM

08-24-2020
03:47 AM

Re: Round up values in drawing table - calculating issue

In your formula, you are flooring the weight to two decimals and then you multiply by the number of items. My guess is that your weight is being rounded to 1.39, then multiplied by 196...which results in 272.44

So try this formula:

MASSE_TOT = floor((rpt_qty+asm_mbr_nbr_spares_pt)*asm_mbr_masse_kg,2)

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-24-2020
05:08 AM

08-24-2020
05:08 AM

Re: Round up values in drawing table - calculating issue

Thank you. Results are close to the desired values, but still not 100% ok.

is must be

1268.88 1268.37 very close but not ok

351.36 350.4 close but, not ok

273.89 274.4 not ok

11.97 11.97 ok

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-24-2020
05:27 AM

08-24-2020
05:27 AM

Re: Round up values in drawing table - calculating issue

Can you show more decimals in the UNIT column? (Something like 8 decimals)

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-24-2020
05:34 AM

08-24-2020
05:34 AM

Re: Round up values in drawing table - calculating issue

Unfortunately not. ;-(

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-24-2020
07:17 AM

08-24-2020
07:17 AM

Without seeing the actual numbers involved, I'm guessing what you want is:

(1) The unit mass is a rounded value, displayed using something like MASS[.2]. When this type of display is done, it rounds the number up/down depending on the rest of the digits.

(2) You want the total mass to be calculated as the total quantity (parts + spares) times this rounded value.

Trouble is, floor doesn't give you the rounded value, it just chops off the remainder of the decimal places, more a text operation than a mathematical one. The "trick" is to make the floor operation act like a rounding function by adding the appropriate half value. So, instead of **floor(mass,2)**, you can use **floor((mass+0.005),2)**. That will effectively "round up" when appropriate.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-24-2020
07:34 AM

08-24-2020
07:34 AM

Re: Round up values in drawing table - calculating issue

Thank you. Now it works as expected.

Have a nice day.