#hargisss-pricing-passonfees

1 messages · Page 1 of 1 (latest)

haughty pecanBOT
grizzled thorn
#

Hi Koopajah

waxen pewter
grizzled thorn
#

Here's the code I'm using right now: $price_amount = ceil(($price_amount + 100) * 1.0298661174) + 30;

waxen pewter
#

hargisss-pricing-passonfees

grizzled thorn
#

But this only works for amounts above about $50

haughty pecanBOT
grizzled thorn
#

It's my best attempt to implement the information on that page, but getting it to work out right for a wide range of amounts is proving difficult.

waxen pewter
#

it works for all amounts, it's math so it's a recurring formula

grizzled thorn
#

Nevertheless, something seems to be going wrong with the rounding. It's exact for amounts above $50, but for small amounts it ends up being one cent off.

#

There's also the added issue that we have an additional 1$ fee.

#

But basically the only way to do this is to make an equation and tweak it until it's right for all values?

turbid flicker
#

👋 hopping in here since koopajah has to head out soon

grizzled thorn
#

Cool thanks Karbi

turbid flicker
#

Yes, really the only way to handle this is by using that equation to calculate it (and tweaking it to account for edge cases like the addition feels you mentioned)

grizzled thorn
#

Okay, I guess that's what I wanted to know - But in theory it should get it possible to make it work for all amounts?

turbid flicker
#

In theory yes

grizzled thorn
#

So I should be using the round function?

#

Okay I'll just try it - no point in wasting any more time for you.

#

The only thing for it is to see if it works.

#

Though- the total amount in this case ending up being too low

#

by one cent

#

so the ceil function could not have been the issue.

#

Thanks!