hi again
I am not sure about this
I am using the following code which is working fine but sometimes returns non whole numbers such as 16.34666667. It happens when the dates are more than about 20 days apart? Is 86400 the right number to divide by to get days?
Is there a way of rounding any result to whole numbers?
carl
sub modify_record {
my ($status, $line, @lines, @data, $output, $found, $restricted);
$compare1 = &date_to_unix($in{'date'});
$compare2 = &date_to_unix($in{'currentdate'});
$total = $compare2-$compare1;
$in{'food'} = $in{'food'} + $in{'addfood'} - ($total/86400);
I am not sure about this
I am using the following code which is working fine but sometimes returns non whole numbers such as 16.34666667. It happens when the dates are more than about 20 days apart? Is 86400 the right number to divide by to get days?
Is there a way of rounding any result to whole numbers?
carl
Code:
sub modify_record {
my ($status, $line, @lines, @data, $output, $found, $restricted);
$compare1 = &date_to_unix($in{'date'});
$compare2 = &date_to_unix($in{'currentdate'});
$total = $compare2-$compare1;
$in{'food'} = $in{'food'} + $in{'addfood'} - ($total/86400);

