Real Number Attribute to string
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
OOTB ,this can be done with calculated attributes fucntions,yoy can use bround() for decimal precision and str() to convert to string
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @hdasilva
Use DataUtility customization and format the realnumber to string
String format = "%.3f %s";
component.setValue(String.format(format, massDouble, unitString));
PetrH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can you help me on how to do it??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
OOTB ,this can be done with calculated attributes fucntions,yoy can use bround() for decimal precision and str() to convert to string
