mIRC Home    About    Download    Register    News    Help

Print Thread
/hinc /hdec added feature #128727 29/08/05 04:41 AM
Joined: Aug 2003
Posts: 72
V
visionz Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Aug 2003
Posts: 72
The possibility to hinc or hdec a non-integer.

ex.:
hinc htable key 0.1
hdec htable key 5.423

Re: /hinc /hdec added feature #128728 29/08/05 11:46 AM
Joined: Jul 2003
Posts: 77
B
bamaboy1217 Offline
Babel fish
Offline
Babel fish
B
Joined: Jul 2003
Posts: 77
very good idea i think the same shoudl apply to inc and dec as well it would be a easy feature to add since im sure hes useing atoi and such to change it to an int which basically ignores the decimal on all he would need to do is store it as a float (or double but a float would probably be enough) and use atof on it instead so it shoudl be a realtivelly easy change.


hmmm signed by me
Re: /hinc /hdec added feature #128729 29/08/05 01:03 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Good idea.


Invision Support
#Invision on irc.irchighway.net
Re: /hinc /hdec added feature #128730 09/09/05 10:23 AM
Joined: Jun 2004
Posts: 65
S
sdamon Offline
Babel fish
Offline
Babel fish
S
Joined: Jun 2004
Posts: 65
the quick and easy fix is decide your level of precision ahead of time and devide use valuex10#-x where x is your level of precision

eg: you need thousandths
store the vale of 1.000 as 1000 and devide by 1000 when accessing data

Re: /hinc /hdec added feature #128731 09/09/05 07:34 PM
Joined: Aug 2003
Posts: 72
V
visionz Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Aug 2003
Posts: 72
If I need a 'quick and easy fix', I will use

; table item n
alias hincf {
hadd $1 $calc($hget($1,$2) + $3)
}

But I would rather see it work correctly without a 'quick fix' :P