Part Relation to get Mass Parameter to 3 decimal places
Hi
We have a crazy relation in our start part that converts the system generated PRO_MP_MASS in a Text Parameter with 3 decimal places, which can then be used to set the weight property within our PLM system, Teamcenter. Im not a fan of this relation as its about 27 lines long. I once found a new relation, shown below, on a website, but cant for the life of me remember where. Trouble is, when Ive come to try it out, its not giving the correct answer, compared to the generated mass property. Dec_P is set as a parameter to 3
RN = FLOOR((PRO_MP_MASS+(5/10^(DEC_P+1))),DEC_P)
IF FLOOR(RN) == 0
MASS = "0."+ITOS((RN-FLOOR(RN))*10^(DEC_P))
ELSE
MASS = ITOS(FLOOR(RN))+"."+ITOS((RN-FLOOR(RN))*10^(DEC_P))
ENDIF

