Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

Shipping by Rules for VirtueMart

IMPORTANT ANNOUNCEMENT: Plugin development ceased, all plugins made available freely (GPL)

With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.

It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!

×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Ceil function giving incorrect result 20 Jan 2015 08:50 #1

  • bmm01
  • bmm01's Avatar Topic Author
I have just installed Version 4.3 of Advanced Shipping Rules.

I have the following expression which is giving me the correct answer prior to rounding, however in the rounding (I have tried round as well as ceil) it's not giving the correct value.

Name=Toll Express {weight} kg; 2000<=ZIP<=2077; Shipping=ceil((0.2345*Weight+4.56),0.05)

Here is my test data:

Qty Base Weight Total Weight Rate Ex GST Inc GST Ceil to 0.05 Result
1 4.56 2.26 2.26 0.2345 5.08997 5.598967 $5.60 5.61
2 4.56 2.26 4.52 0.2345 5.61994 6.181934 $6.20 6.22
3 4.56 2.26 6.78 0.2345 6.14991 6.764901 $6.80 6.77
4 4.56 2.26 9.04 0.2345 6.67988 7.347868 $7.35 7.37
5 4.56 2.26 11.3 0.2345 7.20985 7.930835 $7.95 7.98
6 4.56 2.26 13.56 0.2345 7.73982 8.513802 $8.55 8.53
7 4.56 2.26 15.82 0.2345 8.26979 9.096769 $9.10 9.13
8 4.56 2.26 18.08 0.2345 8.79976 9.679736 $9.70 9.68
9 4.56 2.26 20.34 0.2345 9.32973 10.262703 $10.30 10.29
10 4.56 2.26 22.6 0.2345 9.8597 10.84567 $10.85 10.89

Have I made an error in my syntax for the "ceil(Value,Rounding)"?

Could it be that the tax (GST = 10%) is being added on after the ceil calculation?

Thanks
Brett

Ceil function giving incorrect result 21 Jan 2015 05:15 #2

  • bmm01
  • bmm01's Avatar Topic Author
OK I've worked it out.

The CEIL function is calculating the Shipping Amount correctly however the TAX is being added on after that so the final result is not rounded.

[SOLVED] Ceil function giving incorrect result 21 Jan 2015 05:15 #3

  • bmm01
  • bmm01's Avatar Topic Author
Problem solved.
  • Page:
  • 1