diff --git a/components/protocols/CardUniverse.vue b/components/protocols/CardUniverse.vue index ecf4f55..d28125c 100644 --- a/components/protocols/CardUniverse.vue +++ b/components/protocols/CardUniverse.vue @@ -42,7 +42,7 @@
-

{{ formatPercent(feeAprLifetime) }}

+

{{ formatPercent(feeAprLifetime, 2, true) }}

Fee APR

diff --git a/composables/useFormatting.ts b/composables/useFormatting.ts index 4bbf8d2..519faee 100644 --- a/composables/useFormatting.ts +++ b/composables/useFormatting.ts @@ -32,9 +32,9 @@ export function useFormatting() { } } - function formatPercent(value: any, fractionDigits = 2) { + function formatPercent(value: any, fractionDigits = 2, noLimit = false) { if (isZero(value)) return "0%"; - if (gt(value, 1)) return ">100%"; + if (!noLimit && gt(value, 1)) return ">100%"; const formatter = new Intl.NumberFormat(locale, { style: "percent",