How to write code? To enter the number 0 in front of the thousands

howto
(Suwit Supawas) #1

How to write code? To enter the number 0 in front of the thousands.
EXE. 0001

0 Likes

( ) #2
0 Likes

(Suwit Supawas) #3

I tried but didn’t work.

0 Likes

( ) #4

Please explain more. What exactly you want to ask?

0 Likes

(Suwit Supawas) #5

I want to know how to put the number 0 in front of the thousands, such as 0001, by writing the block, ie if the thousands digits do not have other values, enter 0 instead.

0 Likes

( ) #6

Do you want to add zeros before any digit? but why? :thinking:
You have to do this in a different way like this :point_down:

Capture

Don’t forget to mark it as a SOLUTION if it helps. :slightly_smiling_face:

2 Likes

(Suwit Supawas) #7

I want to add the number by starting 0001, if it reaches 10, it will be left with 2 numbers, such as 0010

0 Likes

( ) #8

I’ve already gave you an example how you can add zeros before any digit.

You can use this block to get the length and then you can add zeros as many as you want.
Capture

1 Like

(Suwit Supawas) #9

I’ll try. If you can’t, you can help. Can you explain more? Because I just learned this

0 Likes

( ) #10

???

Is it worked? or not?

0 Likes

(Suwit Supawas) #11

Not work.

0 Likes

( ) #12

Capture

TEST.aia (2.5 KB)

0 Likes

(Boban Stojmenovic) #13

https://puravidaapps.com/snippets.php#2leadingZeros

/Boban

2 Likes

(Suwit Supawas) #14

Thank you very much for making a sample for me to see, but I tried adding 1. It appears that the number 0 is missing, leaving only one number.

0 Likes

( ) #15

You manually have to add zero again if you increase it by +1

0 Likes

(Suwit Supawas) #16

Work! Thank Boban, MrSid
003

Start text 00000 When click button 00001,00002,00003…

2 Likes