¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: How to add leading zeros to a number


 

Understand, I think....

The string node, pad method will keep the number of characters the same and adjust with the "fill character" to adjust the empty space.? Here are two examples, 50, and 14074.? In each case, the total number of characters out remains as specified, six in this example.

Screen Shot 2021-02-28 at 5.15.39 PM.png

Alan

On Sun, Feb 28, 2021 at 5:09 PM David De Coons wo2x <RocketNJ@...> wrote:
Alan

The issue is he may need 0, 1, or two leading zeroes thus the if else statement is probably best solution.?

73
Dave


Sent from my waxed string and tin cans.?

On Feb 28, 2021, at 5:07 PM, Alan Blind, WA9WUD <a.alan.blind@...> wrote:

?Charlie

Look at the "String" Node, "PadLeft" Method.? You can specify the number of characters and what to use to "fill" the empty space.? Here is an example with six digits, fill left with "0".

Alan

<Screen Shot 2021-02-28 at 5.04.43 PM.png>

Join [email protected] to automatically receive all group messages.