Calculates percentage of a number.
Syntax
import { percentageOf } from '@opentf/std';
percentageOf(percentage: number, num: number): number;
Examples
percentageOf(); // NaN
percentageOf(0); // NaN
percentageOf(undefined, 0); // NaN
percentageOf(0, 0); // 0
percentageOf(1, 0); // 0
percentageOf(1, 1); // 0.01
percentageOf(0.5, 10); // 0.05
percentageOf(10, 80); // 8
percentageOf(50, 900); // 450
percentageOf(17.5, 10); // 1.75