what variable supports 0000?

hey guys so in my project i need to be able to display the number 0000 and be able to use the add function to add 1 to it to make 0001 ive been using integers for everything else but when i got to this part where i need specifically leading 0’s im a bit stuck, i tried using a string but it doesnt seem to work for me

image

as you can see my int is named year and it will not output the other 3 0’s that i need

1 Like

Hey @Leafies121,
How did you try your implementation of the FString? I’d try working with the numbers as integers, but when you go to display them, concatenate the remaining digits (maybe a for loop?) onto the beginning of the value.
I hope this can help!
-Zen

hi thanks for replying this is basically what ive tried with both a string and a int

Try this:

no that doesnt work either

my only solution may be to precalculate the first 1000 numbers
ie if =0 then text = 0000

do you think you could share the bp file for that? idk anything about math expressions

There is no such thing as a number that has leading 0’s. You just format it that way when you want to print it.

3 Likes

yeah that is implied. I am showing you the node you use to concatenate the 000’s in the situation you need it for.

When to add the 000’s is up to you, but that’s just some simple check and if the check fails, then you add your 0’s.

So to summarize, the answer to your original question is “the variable which supports a number beginning with 0’s is a string”, but to build that string from some number you have to concatenate based on some ruleset you design.

1 Like