MCPcopy Create free account
hub / github.com/OverloadBlitz/cloudcent-cli / renderPricesTableWithUsage

Function renderPricesTableWithUsage

internal/estimate/print.go:403–417  ·  view source on GitHub ↗
(prices []resources.PriceEntry, usageQty float64)

Source from the content-addressed store, hash-verified

401}
402
403func renderPricesTableWithUsage(prices []resources.PriceEntry, usageQty float64) string {
404 // Check if any entry has tiered pricing.
405 hasTiers := false
406 for _, p := range prices {
407 if len(p.Tiers) > 0 {
408 hasTiers = true
409 break
410 }
411 }
412
413 if hasTiers {
414 return renderTieredPricesTable(prices, usageQty)
415 }
416 return renderFlatPricesTable(prices)
417}
418
419// renderFlatPricesTable renders the standard single-rate pricing table,
420// hiding Purchase Option / Term / Upfront columns when all values are empty.

Callers 2

PrintResultsFunction · 0.85
renderPricesTableFunction · 0.85

Calls 2

renderTieredPricesTableFunction · 0.85
renderFlatPricesTableFunction · 0.85

Tested by

no test coverage detected