Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

need code for fraction od inches

Anonymous
Not applicable
I have this code in one of my objects but I need to have it show 1/4" or 1/2" or whatever it is but my code just shows whole inches like 36" and not 36 1/2". Here's my existing code:

TEXT2 0, 0, STR("%fi", GLOB_ELEVATION)

WHat do I need to do to get it to show the exact glob_elevation?

Thanks and Happy Thanksgiving,
Michele
2 REPLIES 2
Anonymous
Not applicable
You haven't specified a precision level in your format string, so it defaults to whole inches.

It should be:

TEXT2 0, 0, STR("%0.8fi", GLOB_ELEVATION)

This will give precision to eighths on an inch. For halves the value is "0.2", for sixteenths it is "0.16", etc. It's a little quirky but it makes sense.
Anonymous
Not applicable
Thanks for the code! I'll have to try it out - right now I'm busy trying to get something out.

Thanks again,
Michele