{"uid":"cap_ah3D6Hwqc7OzRL2ZjSgR8","slug":"pricing-math-charm-price-rounding-cb6bc46f","name":"Pricing Math – Charm Price Rounding","description":"Round a price to a charm ending such as .99 or .95, or to steps like 9 at the end of tens, up, down or nearest.","url":"https://pricing-math.x402tookit.com/price-rounding?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["price"],"properties":{"step":{"type":"number","description":"Size of each rounding cell (default 1; use 10 for endings like 49, 59, 69)"},"price":{"type":"number","description":"Raw price to round"},"ending":{"type":"number","description":"Ending to land on within each step (default 0.99; use 0.95, 0.5, 0, or 9 with step 10)"},"direction":{"type":"string","description":"nearest (default, ties go down), down or up"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"step":{"type":["null","number"]},"ending":{"type":["null","number"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"changePct":{"type":["null","number"]},"direction":{"type":["null","string"]},"disclaimer":{"type":["null","string"]},"inputPrice":{"type":["null","number"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"changeAmount":{"type":["null","number"]},"roundedPrice":{"type":["null","number"]},"pricePointAbove":{"type":["null","number"]},"pricePointBelow":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_91wxvkimdQ_GWurqEInYp","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Rounds a raw price to a charm ending (e.g. .99, .95, .5) or step-based ending (e.g. 9 at end of tens), in the nearest, up, or down direction.","exampleAgentPrompt":"Round $47.32 to the nearest .99 charm ending — what's the charm price I should display?","exampleUseCases":[{"title":"Retail product charm pricing","prompt":"I just calculated a cost-plus price of $23.18 for a product — can you round that down to the nearest .99 so it looks better on the shelf?"},{"title":"Tens-step psychological pricing","prompt":"My pricing model gives me $74.60 — round that to the nearest ending of 9 within tens steps (like 69 or 79), whichever is closest."},{"title":"Bulk price list charm rounding","prompt":"I have a wholesale price of $12.43 that I want to round up to the next .95 ending — what should the retail charm price be?"}],"resultDescription":"Returns the rounded charm price, the price points immediately above and below, the absolute and percentage change from the input price, the step and ending used, the direction applied, and a human-readable summary of what was done.","failureModes":["Missing required 'price' query parameter returns an error","Invalid 'direction' value (not nearest/up/down) may cause bad request","Non-numeric price value causes validation failure","Extremely large or negative prices may produce unexpected results if not validated upstream"],"whenToPreferThis":"Use this endpoint when you need to snap a computed or raw price to a psychologically appealing charm ending (.99, .95, .5, or step-based endings like 9 in the tens digit). Prefer it over manual rounding logic when you need directional control (up/down/nearest) and want structured output including the nearby price points and change metrics for audit or display purposes.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T00:34:28.523Z","isFirstParty":false,"canonicalSlug":"pricing-math-charm-price-rounding-cb6bc46f"}