The following formula:
":"+"004"
returns the string
":4"
All zeros are gone. What happened? Meanwhile, I use the workaround:
Format(":{1}","004")
The following formula:
":"+"004"
returns the string
":4"
All zeros are gone. What happened? Meanwhile, I use the workaround:
Format(":{1}","004")
Hmm when I use concatenate and 004 it displays :004 without problem. Can you post your concatenate formula? It might be because you are using + instead of ,.
This Concatenate(":","004")
gives :004
You could also use :
Format(":{1:000}","4")
(as it also gives :004
)
As far as I know though, using "some text"+"some text"
as always seemed a little bit hacky and can lead to βerrorsβ where Concatenate()
has always been reliable .
Yes I was using actually ":"+Format(":{1:000}", "4")
but same problem as above. I use the +. With Concat, the problem goes aways. Still, what is the rule for + ?
β:β+β004β = β:4β
β:β+β114β = β:114β
β:β+β224β = β:224β
β¦
To be honest, I have no idea why the 00
is not recognized here when using "something" + "something"
but I guess, the βruleβ would be to solely use either Concatenate("Text 1","Text 2")
or Format()
and avoid using + "something"
.
The +
is like concatenate()
but not exactly because it can also do maths (addition). Because of this, it tries to do math on things and appears to be treating your β004β as an integer; since 004 = 4 as an integer, it drops the preceding zeroes. concat()
, concatenate()
and format()
are great ways to get around this nuance.