cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Real Number Attribute to string

hdasilva
14-Alexandrite

Real Number Attribute to string

Hello,

 

I need to convert a real number attribute to a string attribute rounded with 3 decimal places.

 

Example:

 

2.0000000000000E-2, on attribute "UNDERSIZE1"

Should be displayed on a new attribute with a value of: 0.002

 

How can I do this? I cannot make this change on Creo, I need to make it on Windchill, maybe using a calculated attribute with a formula?

 

Thanks!

ACCEPTED SOLUTION

Accepted Solutions
Fadel
22-Sapphire II
(To:hdasilva)

OOTB ,this can be done with calculated attributes fucntions,yoy can use bround() for decimal precision and str() to convert to string  

Fadel_0-1700216094483.png

 

 

 https://support.ptc.com/help/wnc/r12.1.1.0/en/index.html#page/Windchill_Help_Center/typeattr/TypeMgrAttrFormula.html 

Fede

View solution in original post

3 REPLIES 3
HelesicPetr
22-Sapphire I
(To:hdasilva)

Hi @hdasilva 

Use DataUtility customization and format the realnumber to string 

String format = "%.3f %s";
component.setValue(String.format(format, massDouble, unitString));

 PetrH

hdasilva
14-Alexandrite
(To:HelesicPetr)

Can you help me on how to do it??

Fadel
22-Sapphire II
(To:hdasilva)

OOTB ,this can be done with calculated attributes fucntions,yoy can use bround() for decimal precision and str() to convert to string  

Fadel_0-1700216094483.png

 

 

 https://support.ptc.com/help/wnc/r12.1.1.0/en/index.html#page/Windchill_Help_Center/typeattr/TypeMgrAttrFormula.html 

Fede
Announcements


Top Tags