Don't use SI units in address balance graph axis

This commit is contained in:
natsoni 2024-11-19 18:00:00 +01:00
parent 7516db0c71
commit 8bd6d40ed2
No known key found for this signature in database
GPG Key ID: C65917583181743B

View File

@ -309,10 +309,10 @@ export class AddressGraphComponent implements OnChanges, OnDestroy {
formatter: (val): string => {
let valSpan = maxValue - (this.period === 'all' ? 0 : minValue);
if (valSpan > 100_000_000_000) {
return `${this.amountShortenerPipe.transform(Math.round(val / 100_000_000), 0)} BTC`;
return `${this.amountShortenerPipe.transform(Math.round(val / 100_000_000), 0, undefined, true)} BTC`;
}
else if (valSpan > 1_000_000_000) {
return `${this.amountShortenerPipe.transform(Math.round(val / 100_000_000), 2)} BTC`;
return `${this.amountShortenerPipe.transform(Math.round(val / 100_000_000), 2, undefined, true)} BTC`;
} else if (valSpan > 100_000_000) {
return `${(val / 100_000_000).toFixed(1)} BTC`;
} else if (valSpan > 10_000_000) {
@ -320,7 +320,7 @@ export class AddressGraphComponent implements OnChanges, OnDestroy {
} else if (valSpan > 1_000_000) {
return `${(val / 100_000_000).toFixed(3)} BTC`;
} else {
return `${this.amountShortenerPipe.transform(val, 0)} sats`;
return `${this.amountShortenerPipe.transform(val, 0, undefined, true)} sats`;
}
}
},
@ -334,7 +334,7 @@ export class AddressGraphComponent implements OnChanges, OnDestroy {
axisLabel: {
color: 'rgb(110, 112, 121)',
formatter: function(val) {
return `$${this.amountShortenerPipe.transform(val, 0)}`;
return `$${this.amountShortenerPipe.transform(val, 0, undefined, true)}`;
}.bind(this)
},
splitLine: {