Separate three digits - Forum

Forum Navigation
You need to log in to create posts and topics.

Separate three digits

How can I separate three digits like a calculator?

Uploaded files:
  • You need to login to have access to uploads.

Do you mean like this?

Uploaded files:
  • You need to login to have access to uploads.
luishp, javadrajabihakami and susan have reacted to this post.
luishpjavadrajabihakamisusan

just this code?

BEGINJS
$App.x = $App.input.toLocaleString();
ENDJS

 

Another way that doesn't rely on the locale settings of the pc and in plain NeoScript is:

StrLen [buffer] [bufferLen]
SetVar [index] [bufferLen]-3
While [index] > 0
   StrIns "," [buffer] [index] [buffer]
   SetVar [index] [index]-3
EndWhile

where buffer contains the number as a string.

luishp has reacted to this post.
luishp

@tilesoft, @asmat, @susan have you checked the included NumberToLocaleString core command?
It will format a number to be shown according the the selected locale format.
Please let me know if it solves the problem.

Thank you!

asmat and susan have reacted to this post.
asmatsusan

Thanks, Luis, I found it, that is the best solution.