_Dean_ commented on a Page, calculator dialog  -  Sep 10, 2011

as Jethro said, i think that use a $replacex is better
i added the /
since on your original code, you didnt put the sclick for $did 3

on *:dialog:calc:sclick:*:{ 
  if ($did isnum 3-12) {  
    did -a calc 19 $replacex($did,3,/,4,*,5,-,6,7,7,8,8,9,9,+,10,4,11,5,12,6)
  }
  if ($did isnum 14-18) { did -a calc 19 $replacex($did,14,1,15,2,16,3,17,0,18,.) }
  if ($did isnum 22-24) { did -a calc 19 $replacex($did,22,k,23,m,24,b) }
  if ($did == 25) { did -r calc 19 }
  if ($did == 20) {
    if (!$did(19)) { noop $input(Please specify a calculation in the edit box and click calculate,w,Warning!) }
    else {
      did -ra calc 19 $bytes($calc($replace($did(19),k,000,m,000000,b,000000000)),b))
    }
  }
}

this calculator has no accuracy, since if you use 7.3/2 it will return 4

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.