Format Attribute value
Dear all,
Is there any way to format an attribute value in a specific format. Il Mean, I wish I could display the value an attribute as a number with 2 digits after the comma like 0,80 even if I Type 0,8 in the property filed.
Thanks you for your help.
BR
Comments
-
As far as I know the attributes store text. Even numbers in an attribute are text and not numerical values so you don't have that leading / trailing zero value that you are after. You can put fields into an attribute which can contain true numbers and be formatted, but the field would need a target to have the value in.
1 -
You can do stuff like convert to a string and adjust decimal.
(setq val (getreal "\nEnter value "))
(setq frac (- val (fix val)))
(setq dec (substr (rtos frac 2 2) 2))
(setq str (strcat (rtos (fix val) 2 0) dec))You still have the value but a new string with padding.
0