Sephiroth
http://sephiroth.scifi-action.de/board/

$dot()
http://sephiroth.scifi-action.de/board/viewtopic.php?f=4&t=12
Seite 1 von 1

Autor:  Sephiroth [ 18. März 2008 00:08 ]
Betreff des Beitrags:  $dot()

;; $dot(1000) -> 1.000
;; $dot(-1000.5) -> -1.000,5
;;
;; * Update: Fixed for mIRC 6.17
dot {
  if ($1 isnum) {
    var %1 = $1
    if ($left($1,1) == -) var %pre = -
    if (. isin $1) var %1 = $gettok($1,1,46),%2 = $gettok($1,2,46)
    if (($2 isnum) && (%2)) %2 = $left(%2,$2)
    tokenize 32 $remove(%1,-)
    var %x = $len($1),%out
    while (%x) {
      if ($right($1,3) != $null) {
        %out = $+($ifmatch,$iif(%out != $null,.),%out)
        tokenize 32 $left($1,-3)
      }
      dec %x 3
      if (%x < 0) { unset %x }
    }
    return %pre $+ $iif(%out,%out,0) $+ $iif(%2,$chr(44) $+ %2)
  }
}

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/