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.
Decimal Places in BOM for Custom Properties
jacques_spillmann
OS Professional Posts: 68 PRO
Is there a way to make this better?
Possible to round off to 2 decimal places? These are custom properties defined as double (I do need a number for agregation so I can see the total cost of an assembly for example)
Tagged:
0
Answers
it seems it might be an issue with the rounding function that maybe does not round properly?
Example here, first line seems ok but second line not:
Here is the function I'm using to calculate that parameter:
round(#cabinet_vol/(1e6 mm^3)-#LF_Displaced_Volume-#WA_Displaced_Volume-#HF_Displaced_Volume,0.1)
ok! I think I figured it out, I used RoundToPrecision instead of round…
But now I'm strugling with how to use RoundToPrecision in featurescript, it doesn't seem to work when I do this:
const weight = roundToPrecision(volume * definition.density, 2);
throws this error: