From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
For example. I want to convert a string 6 to 0000006. I used the format specifier %07d. By I am getting 6000000 instead of 0000006 . It would be great if I get a solution for this.
I'm assuming you are starting with a string representing an integer, and want a string of 7 digits, padded with (leading) zeros. The solution is very simple -- Scan from String (to convert the String into an I32) and wire that directly into Format into String with a format of %07d.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5