Jump to content
Developer Wiki and Function Reference Links ×

Displaying a variable as a number rather than dimension?


Recommended Posts

I have a variable that I want to display in the object info palette.

For instance, the value of the variable is 9.

I set up a static text and use a setfield to display the 9 in the OIP. For some reason the 9 is displayed as 9" rather than 9. If I change the variable to 12 it displays 1'-0". How do I get it to display 12 instead of 1'-0"?

Thanks,

Derek

Link to comment

Raymond,

Thank you, I was originally using Num2StrF(). Your suggestion to use Num2Str() has solved my problem.

Marteen,

I attempted to convert the real to an integer first and it remained in the dimension form.

Jonathan,

The fields I'm using to do the calculations are Dimensions. The field I'm using to display my calculation is Static Text. Therefor, I needed a way to convert the dimension to a real number.

Derek

Edited by MaxStudio
Link to comment
Using Concat() to make a string of a number could have solved it too I think.

There is a difference between Concat and Num2Str, basically format control. Num2Str will let you set the number of decimal places you see from 0 to 10. Concat will show all decimal digits (up to 15 if they exist). Both are useful in their own right.

Raymond

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...