mirror of
https://github.com/Instadapp/assembly.git
synced 2024-07-29 22:37:06 +00:00
fix: percent can be gt 100
This commit is contained in:
parent
1168467ee2
commit
ddeedcf8e6
|
@ -42,7 +42,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ml-auto text-right">
|
<div class="ml-auto text-right">
|
||||||
<p class="leading-8 text-lg font-bold text-green-500">{{ formatPercent(feeAprLifetime) }}</p>
|
<p class="leading-8 text-lg font-bold text-green-500">{{ formatPercent(feeAprLifetime, 2, true) }}</p>
|
||||||
<div class="h-4 flex">
|
<div class="h-4 flex">
|
||||||
<p class="text-sm font-medium text-[#9FB0C9]">Fee APR</p>
|
<p class="text-sm font-medium text-[#9FB0C9]">Fee APR</p>
|
||||||
<Info class="ml-1 h-3" text="Trading fees earned in Uniswap V3 pool" />
|
<Info class="ml-1 h-3" text="Trading fees earned in Uniswap V3 pool" />
|
||||||
|
|
|
@ -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 (isZero(value)) return "0%";
|
||||||
if (gt(value, 1)) return ">100%";
|
if (!noLimit && gt(value, 1)) return ">100%";
|
||||||
|
|
||||||
const formatter = new Intl.NumberFormat(locale, {
|
const formatter = new Intl.NumberFormat(locale, {
|
||||||
style: "percent",
|
style: "percent",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user