pricebrk.m

pricebrk.m(T.initPrice: number, U.qty: number, U.newPrice: number) -> T.price : zedfunc, function

Merchant 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.m(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 5
6 9
7 9
8 9
9 9
10 -1
11 8
12 8

See also

User Contributed Notes
0 notes + add a note