mirror of
https://github.com/cerc-io/mars-interface.git
synced 2025-07-05 16:18:00 +00:00
9 lines
305 B
TypeScript
9 lines
305 B
TypeScript
import { formatValue } from 'libs/parse'
|
|
|
|
export const convertPercentage = (percent: number) => {
|
|
let percentage = percent
|
|
if (percent >= 100) percentage = 100
|
|
if (percent !== 0 && percent < 0.01) percentage = 0.01
|
|
return Number(formatValue(percentage, 0, 2, false, false, false, false, false))
|
|
}
|