pricebrk.f
pricebrk.f(T.initPrice: number, U.qty: number, U.newPrice: number) -> T.price : zedfunc, function
Fiscal variant of the price break function. Returns the zedfunc representing the marginal purchase unit price from a table listing the price breaks.
Example
table T = with
[| as StartPrice |]
[| 10 |]
table B = extend.range(2 into T)
B.Qty = if B.N == 1 then 5 else 10
B.NewPrice = if B.N == 1 then 9 else 8
T.Z = pricebrk.f(T.StartPrice, B.Qty, B.NewPrice)
table U = extend.range(12 into T)
U.Qty = U.N
U.Price = valueAt(T.Z, U.Qty)
show table "Marginal price" with
U.Qty
U.Price
This outputs the following table:
| Qty | Price |
|---|---|
| 1 | 10 |
| 2 | 10 |
| 3 | 10 |
| 4 | 10 |
| 5 | 9 |
| 6 | 9 |
| 7 | 9 |
| 8 | 9 |
| 9 | 9 |
| 10 | 8 |
| 11 | 8 |
| 12 | 8 |