Decimal Places in BOM for Custom Properties

jacques_spillmann
jacques_spillmann OS Professional Posts: 74 PRO

Is there a way to make this better?

image.png

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)

Answers

  • jacques_spillmann
    jacques_spillmann OS Professional Posts: 74 PRO

    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:

    image.png

    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)

  • jacques_spillmann
    jacques_spillmann OS Professional Posts: 74 PRO

    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:

    image.png