Formats a ratio (0–1 scale) as a human-readable percent string.
A ratio, typically between 0 and 1.
Decimal places to keep in the output. Defaults to 1.
1
A string such as "25.3%".
"25.3%"
toPercentString(0.2525); // "25.3%"toPercentString(0.2525, 2); // "25.25%" Copy
toPercentString(0.2525); // "25.3%"toPercentString(0.2525, 2); // "25.25%"
Formats a ratio (0–1 scale) as a human-readable percent string.