natureguy, on 27 October 2009, 16:27, said:
It's been a week and no response

I had to remove this add-on. Is anyone really getting this add-on to work? I had an unresolvable error as soon as I tried to edit an order, call to an undefined function tep_round_up() on line 162 of the USPS Methods 4.3.1 add on module, usps.php. I haven't had an issue with USPS Methods before. No one has ideas??? Being able to edit orders is rather important and I would sure have liked to have this thing running. Has the tax issues been resolved? I read a lot of issues with people having troubles with adding correct tax.
Ha ha, I took the long way around the barn and figured this out. It works perfect now. I googled "tep_round_up" and found a solution buried in the forums here. Anyone with USPS Methods V4.3.1 will need to add this to their catalog/admin/includes/funtions/general.php file: (I put it around where USPS Methods are located.)
////
// Round up function for non whole numbers by GREG DEETH
// The value for the precision variable determines how many digits after the decimal and rounds the last digit up to the next value
// Precision = 0 -> xx.xxxx = x+
// Precision = 1 -> xx.xxxx = xx.+
// Precision = 2 -> xx.xxxx = xx.x+
function tep_round_up($number, $precision) {
$number_whole = '';
$num_left_dec = 0;
$num_right_dec = 0;
$num_digits = strlen($number);
$number_out = '';
$i = 0;
while ($i + 1 <= strlen($number))
{
$current_digit = substr($number, $i, ($i + 1) - $num_digits);
if ($current_digit == '.') {
$i = $num_digits + 1;
$num_left_dec = strlen($number_whole);
$num_right_dec = ($num_left_dec + 1) - $num_digits;
} else {
$number_whole = $number_whole . $current_digit;
$i = $i + 1;
}
}
if ($num_digits > 3 && $precision < ($num_digits - $num_left_dec - 1) && $precision >= 0) {
$i = $precision;
$addable = 1;
while ($i > 0) {
$addable = $addable * .1;
$i = $i - 1;
}
$number_out = substr($number, 0, $num_right_dec + $precision) + $addable;
} else {
$number_out = $number;
}
return $number_out;
}