finance

Use this when you want exact, auditable percentage math with a written-out formula.

Use this when you want exact, auditable percentage math with a written-out formula. Three modes: "of" computes percent% of value (fields percent, value); "is-what" computes what percent x is of y (fields x, y; y must be non-zero); "change" computes the percent change from -> to (from must be non-zero) and reports direction as "increase" or "decrease". Returns the numeric result plus a human-readable formula string. Deterministic: same input, same output. Example: mode="change", from=200, to=250 -> result=25, direction="increase".

post/v1/percentage

Request

  • Base URL: https://api.clean.tools
  • URL: https://api.clean.tools/v1/percentage
  • Auth: none declared

Request body

mode'of' | 'is-what' | 'change' required

Which calculation to perform. "of" = percent% of value; "is-what" = x is what percent of y; "change" = percent change from -> to.

percentnumber

(mode "of") The percentage to apply, e.g. 15 for 15%.

valuenumber

(mode "of") The base value that the percentage is taken of.

xnumber

(mode "is-what") The part value.

ynumber

(mode "is-what") The whole value; must be non-zero.

fromnumber

(mode "change") The starting value; must be non-zero.

tonumber

(mode "change") The ending value.

Response

Structured tool result.

toolstring

Changes

No recorded changes to this operation across all 1 revision of this API.