Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
formatting number with commas
#4
This also works for double.
Code:
Copy      Help
str s="-1234567.1234567"
strrev s
s.replacerx("(\d{3})(?=\d+($|[^\.\w]))" "$1,")
strrev s
out s

There should be an API function for this, but I could not find.


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)