Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: Tim MeagherHi,
You would normally use the
format operator to perform string formatting on an int. Someone can correct me if I'm wrong, but I can't see any way to do what you want with the format operator.
The easiest way that I can see to do this in BRAINscript is using something like the following, for an input integer field "x":
formattedInt = ""
remainder = x
while remainder > 1000 {
formattedInt = "," + remainder % 1000 + formattedInt
remainder = remainder.div(1000)
}
formattedInt = remainder + formattedInt
emit formattedInt