Docs/Format Utils/GET /v1/percentage

GET /v1/percentagePercentage calculator

Format Utils lf-format-utils

Works out percentage sums, like what one number is as a share of another. Percentage calculator

Query Parameters

ParameterTypeRequiredDescription
modestringYespercent_of, percent_change, or value_from_percent
xnumberNoFirst operand
ynumberNoSecond operand

Response Schema

result (number): Computed value
mode (string): Mode used
formula (string): Human-readable formula

cURL Example

curl 'https://lf-format-utils.laminarforge.dev/v1/percentage?mode=<mode>' -H 'Authorization: Bearer lf_YourApiKey'

Python Example

import requests
url = 'https://lf-format-utils.laminarforge.dev/v1/percentage'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'mode': '<mode>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())