Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
formula troubles..

I'm gonna show my messy math in this query so beware…
Where #Width is a length in mm:
((#Width-74 mm)/(4*(#Width/1000 mm))mm)mm
works fine (don't touch it, it's cursed)
but when I try to do
((#Width-74 mm)/round(4*(#Width/1000 mm))mm)mm
it says i can't round an area???
- where is it getting the idea that (int*(mm/mm)) is an area,
- why would the first equation work if that is calculated to be an area, and
- how do i fix this, or what is an equivalent equation to do the same thing?
Best Answer
-
MichaelPascoe Member Posts: 2,367 PRO
.
Onshape was reading your equation like this:
#Width/1000) * mm
. To fix this, emphasize that you want themm
multiplication to only apply to the 1000, like this:4*(#Width/(1000 mm))
⚠️ I recommend splitting up the 74mm and the 1000mm into their own variables so that there is less confusion and possible errors.
But if you do want to cram it all into one, here is how you can do it:
(#Width-(74mm))/round((4*(#Width/(1000 mm))), 1)
Or if you intent was to round the final number to 1mm, then do this:
round((#Width-(74mm))/(4*(#Width/(1000 mm))), 1mm)
Note that if you want to round unitless values to specific decimal places, you would need to use this function:
roundToPrecision(#Number, 3)
.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴1
Answers
.
Onshape was reading your equation like this:
#Width/1000) * mm
. To fix this, emphasize that you want themm
multiplication to only apply to the 1000, like this:4*(#Width/(1000 mm))
⚠️ I recommend splitting up the 74mm and the 1000mm into their own variables so that there is less confusion and possible errors.
But if you do want to cram it all into one, here is how you can do it:
(#Width-(74mm))/round((4*(#Width/(1000 mm))), 1)
Or if you intent was to round the final number to 1mm, then do this:
round((#Width-(74mm))/(4*(#Width/(1000 mm))), 1mm)
Note that if you want to round unitless values to specific decimal places, you would need to use this function:
roundToPrecision(#Number, 3)
.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Legendary, Thanks Heaps