The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Everything about GDL - Doors/Windows/Objects/Stairs etc. (Example: I created an object that prints an error message in 3D all the time, please help!)

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, Gergely Feher

By Michele
#49261
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
User avatar
By Matthew Lohden
#49276
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.