mIRC Homepage
Posted By: visionz /hinc /hdec added feature - 29/08/05 04:41 AM
The possibility to hinc or hdec a non-integer.

ex.:
hinc htable key 0.1
hdec htable key 5.423
Posted By: bamaboy1217 Re: /hinc /hdec added feature - 29/08/05 11:46 AM
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.
Posted By: Riamus2 Re: /hinc /hdec added feature - 29/08/05 01:03 PM
Good idea.
Posted By: sdamon Re: /hinc /hdec added feature - 09/09/05 10:23 AM
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
Posted By: visionz Re: /hinc /hdec added feature - 09/09/05 07:34 PM
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
© mIRC Discussion Forums