Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
In my script, I would like to do like the num() function, but for the string.
for example :
Y = 50
X = num(Y,0000);
==> then X = 0050.
I need to do the same but with the blank character (before or after). if Y = 50, I need to have X = ' 50' or X = '50 '
A function is available for this ?
Thanks in advance.
Hi,
Do you mean this?
=Text(Repeat(' ', 4 - Len(Y)) & Y)
4 is the fixed length of the maximum number of chars that your string should have. If Y = 50, then it will add two spaces before the value of Y. Similarly, you can do it to put the spaces after the value of Y:
=Text(Y & Repeat(' ', 4 - Len(Y)))
Hope that helps.
Miguel
Hi,
Do you mean this?
=Text(Repeat(' ', 4 - Len(Y)) & Y)
4 is the fixed length of the maximum number of chars that your string should have. If Y = 50, then it will add two spaces before the value of Y. Similarly, you can do it to put the spaces after the value of Y:
=Text(Y & Repeat(' ', 4 - Len(Y)))
Hope that helps.
Miguel
it works, thanks you.
but now I will try to solve my last problem : I think it's a problem with a proportionnal font.
because I have now :
5000
5000
5000
5000
Hi,
It seems you need some trimming in your results, or better in your input code:
Text(Repeat(' ', 4 - Len(Trim(Y))) & Trim(Y))
Hope that helps
Miguel