Numbers math pct of total
Exactnumbers_math_pct_of_totalDeterministic and authoritative — the canonical answer for this input.
Return part / total as a fraction plus a formatted display string. Rejects total=0.
Parameters
partnumberrequiredtotalnumberrequiredCall it
curl -X POST https://api.snipget.ai/v1/numbers/math/pct-of-total \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"part":25,"total":100}'Example response
{
"fraction": 0.25,
"display": "25.00%",
"part": 25,
"total": 100
}FAQ
What does this do?
It tells you what share one number is of another, for example 25 out of 100 is 25%. It returns the raw fraction (0.25), a ready-to-show string ('25.00%'), and both inputs so the result is self-documenting.
Why not just divide the two numbers myself?
You can, but this gives you a consistent, correctly formatted percentage every time and handles the divide-by-zero case for you, which is easy to forget in a spreadsheet or a quick script.
What do part and total mean?
Part is the piece you are measuring and total is the whole it belongs to. The result is part divided by total. If your part is larger than the total you simply get a percentage above 100%.
Is the result exact?
Yes, it is a deterministic calculation. The same part and total always return the same authoritative fraction.
What if the total is zero?
You cannot take a percentage of zero, so the tool returns a result flagged is_valid false with a why_invalid reason and confidence 0, instead of erroring out.