SOLVED!
Format numbers with leading zeros ?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-08-31
01:15 AM
- last edited on
‎2022-09-26
10:45 PM
by
Daniel Kassai
‎2020-08-31
01:15 AM
Hi everyone,
Here is a simple question, how to convert integer numbers to strings with leading zeros using str or str{2} functions ?
ex:
1 to be show as 01 or 001
Here is a simple question, how to convert integer numbers to strings with leading zeros using str or str{2} functions ?
ex:
1 to be show as 01 or 001
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Solved! Go to Solution.
Labels:
- Labels:
-
Library (GDL)
1 ACCEPTED SOLUTION
Accepted Solutions
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-08-31 07:34 AM
‎2020-08-31
07:34 AM
After you converted it, you should inquire the length of the string (which will be 1, 2, or 3), and depending on that value, fill the beginning of the string with leading "0" characters.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-08-31 03:31 AM
‎2020-08-31
03:31 AM
If the format string for the STR function was like normal programming languages, this would be easy, but alas it is 'unique' and seems to have no way of producing leading zeros.
AC 28 USA and earlier • macOS Sequoia 15.3.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-08-31 07:34 AM
‎2020-08-31
07:34 AM
After you converted it, you should inquire the length of the string (which will be 1, 2, or 3), and depending on that value, fill the beginning of the string with leading "0" characters.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-08-31 12:29 PM
‎2020-08-31
12:29 PM
Thank you all
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
