Skip to main content
1-Visitor
March 30, 2020
Solved

Rounding decimals to the nearest fraction

  • March 30, 2020
  • 4 replies
  • 2373 views

My company has a drafting standard that requires the dimension displays to be in decimal format. The parts are relationally driven. On occasion there is a part that we need to outsource, and the vendor requires shaft lengths to the nearest 1/16". 

So is there a to keep the decimal display, but way to round the nearest .0625"?

Best answer by TomU

Add a relation statement like this for any value that needs to be on a certain increment.

/* Round to nearest 1/16
IF MY_DIM != ((FLOOR((MY_DIM * 16) + 0.5)) / 16)
 MY_DIM = ((FLOOR((MY_DIM * 16) + 0.5)) / 16)
ENDIF

 

4 replies

23-Emerald III
March 30, 2020

Dual dimension with the dual units in fractions?

1-Visitor
April 15, 2020

This is not possible at this time.

TomU23-Emerald IVAnswer
23-Emerald IV
March 31, 2020

Add a relation statement like this for any value that needs to be on a certain increment.

/* Round to nearest 1/16
IF MY_DIM != ((FLOOR((MY_DIM * 16) + 0.5)) / 16)
 MY_DIM = ((FLOOR((MY_DIM * 16) + 0.5)) / 16)
ENDIF

 

uogbsd1-VisitorAuthor
1-Visitor
March 31, 2020

Brilliant!

Thanks, that did it.