As far as I know, this plugin’s maths function can do round() and ceil().
And the ceil is always round up to an integer. Round will round up or down to an integer too.
Round up to .5 I don’t think it is possible. Will wait for the answer from Author.
@deardevils One of the tricks would be doing like this: max(0.5,{var}). This way you get 0.5 when {var} is less then 0.5, but you get {var} value is it is greater than 0.5.
@wee2326 Please, study this example. Maybe it is something you want.
Is this setting correct?
The formula doesn’t work
https://prnt.sc/103mkbg
http://prnt.sc/103ml08
Thanks.
Why? What is the url of your product?
@moomooagency the max(var1,var2,var3) is for picking the biggest number, what @wee2326 mean is he wants to pick the rounded up numbers, for example, 1.1kg ->1.5kg, 2.6kg->3kg.
It is not a standard js function, as round or ceil etc only change to integer.
So another tricky way for you @wee2326 make a matrix range instead.
For example:
real weight 0.01 0.50 0.51 1.00 1.01 1.50 1.51 2.00 2.01 2.50
new weight 0.50 0.50 1.00 1.00 1.50 1.50 2.00 2.00 2.50 2.50
People input real weight, then matrix generate newer rounded up weight.
Then use the newer weight times the unit price.
Thanks for your reply! @deardevils
But this is used to calculate the weight of checked baggage
So there is no weight limit…
Then prob the easiest way is using ceil().
Not accurate as you expected, but at least you won’t lose money on that, lol.
@wee2326 in this case, you could use weight/0.5, then roundup.
For example, 2.3/0.5 = 4.6 -> roundup to 5
Then 5 x 0.5 again then times your unit price.
Easy as.
@deardevils
Is it set like this?
https://prnt.sc/104ej1m
http://prnt.sc/104ejfr
I donβt know how to set it up
Thanks.
Let’s say your input field’s name is {uni_cop_weight}
create a NOV called {uni_cpo_nov_weight} = ceil({uni_cop_weight}/0.5)
In the main formula, use {uni_cpo_nov_weight}*0.5*8.5
@deardevils
Thanks a lot for help!
The price can be calculated correctly!! π
@wee2326 Can we close this topic?