All pastes #397472 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-16 14:49 UTC
rendered paste body
alias comma {
  if ($1- isnum) {
    tokenize 32 $remove($1-,-)
    var %x = 1
    var %y = $ceil($eval($calc($len($1-) / 3)))
    while (%x <= %y) {
      var %comma = $+($chr(44),$right($1-,3),%comma)
      tokenize 32 $left($1-,-3)
      inc %x
    }
    while ($left(%comma,1) iswm $chr(44)) { var %comma $right(%comma,-1) }
    return %comma
  }
  else { return 0 }
}