NumToStr formatting

Hi,
I am struggling with NumToStr formatting:
AllBars=LastValue(Barindex())+1;
periods= NumToStr(AllBars,0);

periods is used in StrExtract( periods, j ) but as the number of bars is 9,347 (nine thouhsands etc) I get
two differnt strings

  1. 9
  2. 397

how can I format periods= NumToStr(AllBars,0); to 9347 instead of 9,347?
Any help would be welcome.

AllBars=LastValue(Barindex())+1;
if (RegPeriods ==0) 
periods= NumToStr(AllBars,0);
if (RegPeriods ==1) 
periods="60,250," + AllBars; 
for ( j = 0; ( num = StrExtract( periods, j ) )  != "";  j++ )
{ 	pds = StrToNum(num);

See function reference
https://www.amibroker.com/guide/afl/numtostr.html
So set 3rd argument to false.

periods = NumToStr(AllBars, 0, false);

Thanks Fx, I wasted 45 minutes of my time, and the answer was there but I could understand it. When programming is not your job ..................