mIRC Home    About    Download    Register    News    Help

Print Thread
#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

Joined: Jul 2003
Posts: 77
B
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
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Good idea.


Invision Support
#Invision on irc.irchighway.net
Joined: Jun 2004
Posts: 65
S
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

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


Link Copied to Clipboard