Calculates percentage of a value with total.
Syntax
import { percentage } from '@opentf/std';
percentage(value: number, total: number): number;
Examples
percentage(0, 0); // NaN
percentage(1, 0); // Infinity
percentage(1, 1); // 100
percentage(0.5, 1); // 50
percentage(25, 100); // 25
percentage(75, 150); // 50
percentage(8, 800); // 1
percentage(5, 150); // 3.3333333333333335
percentage(200, 100); // 200