calcCost returns the cost in fractional microdollars (millionths of a USD) for the given token count at the specified per-million-token price.
(tokens *int64, pricePerMillion *decimal.Decimal)
| 67 | // calcCost returns the cost in fractional microdollars (millionths of a USD) |
| 68 | // for the given token count at the specified per-million-token price. |
| 69 | func calcCost(tokens *int64, pricePerMillion *decimal.Decimal) decimal.Decimal { |
| 70 | return decimal.NewFromInt(ptr.NilToEmpty(tokens)).Mul(ptr.NilToEmpty(pricePerMillion)) |
| 71 | } |
no test coverage detected