cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Round up in relation/ program

EL_10548943
5-Regular Member

Round up in relation/ program

Hello, 

I would like to know if it's possible to round up the number with the function CEIL / FLOOR at hundreds.

I only can round at the unity.

Exemple I have 5900/6 = 983.333...

I would like to set this value to 1000

thank you for reading.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

To do what you are describing you need to divide the number you are manipulating by 1000, get the ceil of that, then multiply the result by 1000.

For your example, this would read:

 

result = 1000 * ceil ( ( 5900 / 6 ) / 1000 )

 

If you are trying to actually "round" the value, i.e. any value between 500 and 999 yields 1000, numbers less than 500 are zero, you need to do something more like:

result = 1000 * floor ( ( 5900 / 6 ) / 1000 + 0.5 )

 

in the "ceil ( value, decimal )" command the "decimal" parameter is telling the function which decimal digit to "cut off" the result at. ceil ( 5.234, 2 ) means start at the second decimal place, so the result of ceil ( 5.234, 2 ) = 5.240. A negative "decimal" value is not valid.

 

View solution in original post

4 REPLIES 4
EL_10548943
5-Regular Member
(To:EL_10548943)

In the guide of PTC it is write that you can do round after the comma, " ceil (10.2)."

So i tried to do it with a negative number " attached"

But it doesnt work....

 

 

To do what you are describing you need to divide the number you are manipulating by 1000, get the ceil of that, then multiply the result by 1000.

For your example, this would read:

 

result = 1000 * ceil ( ( 5900 / 6 ) / 1000 )

 

If you are trying to actually "round" the value, i.e. any value between 500 and 999 yields 1000, numbers less than 500 are zero, you need to do something more like:

result = 1000 * floor ( ( 5900 / 6 ) / 1000 + 0.5 )

 

in the "ceil ( value, decimal )" command the "decimal" parameter is telling the function which decimal digit to "cut off" the result at. ceil ( 5.234, 2 ) means start at the second decimal place, so the result of ceil ( 5.234, 2 ) = 5.240. A negative "decimal" value is not valid.

 

EL_10548943
5-Regular Member
(To:KenFarley)

Thank you for your answer ! 

I had the formula in mind  but tahnk you for remind me clearly! 

What I had in my mind by negative number was more like on Excel, when you put a négative number it goes up and round in the tens and hundreds value.

I'm new on the program and relation of CREO so maybe it was a stupid question...

 

 

 

Relations are kind of a unique thing. Weird that there's not a simple "round" function, so we're forced to do messy things like what I suggested.

Top Tags