From f8a1fc6aa23e8b4474bf8ea614d48ee5ba1e2686 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Thu, 21 Mar 2024 02:49:31 +0000 Subject: [PATCH] Fix address chart y-axis labels --- .../address-graph/address-graph.component.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/components/address-graph/address-graph.component.ts b/frontend/src/app/components/address-graph/address-graph.component.ts index ab137e52b..6c0f7f919 100644 --- a/frontend/src/app/components/address-graph/address-graph.component.ts +++ b/frontend/src/app/components/address-graph/address-graph.component.ts @@ -139,14 +139,16 @@ export class AddressGraphComponent implements OnInit, OnChanges { axisLabel: { color: 'rgb(110, 112, 121)', formatter: (val): string => { - if (maxValue > 100_000_000) { + if (maxValue > 1_000_000_000) { return `${this.amountShortenerPipe.transform(Math.round(val / 100_000_000), 0)} BTC`; + } else if (maxValue > 100_000_000) { + return `${(val / 100_000_000).toFixed(1)} BTC`; } else if (maxValue > 10_000_000) { - return `${Math.round(val / 100_000_000)} BTC`; - } else if (maxValue > 100_000) { return `${(val / 100_000_000).toFixed(2)} BTC`; + } else if (maxValue > 1_000_000) { + return `${(val / 100_000_000).toFixed(3)} BTC`; } else { - return `${this.amountShortenerPipe.transform(100_000_000, 0)} sats`; + return `${this.amountShortenerPipe.transform(val, 0)} sats`; } } },