mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* rename feature * rename evn preset * types, mocks and stubs renaming * rename UI components
13 lines
328 B
TypeScript
13 lines
328 B
TypeScript
import { hairsp } from 'toolkit/utils/htmlEntities';
|
|
|
|
export function formatPercentage(percentage: number) {
|
|
const value = Math.round(percentage * 100);
|
|
if (value === 0 && percentage > 0) {
|
|
return `<${ hairsp }1%`;
|
|
}
|
|
if (value === 100 && percentage < 1) {
|
|
return `>${ hairsp }99%`;
|
|
}
|
|
return `${ value }%`;
|
|
}
|