From f775e9d7a4b4efc494a9b195e67c4fb5c9981787 Mon Sep 17 00:00:00 2001 From: Thomas Speer Date: Sat, 23 Aug 2025 19:41:54 +0200 Subject: [PATCH] Sessions UI: show decimal in scale for low money values (#23202) --- assets/js/components/Sessions/CostHistoryChart.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/assets/js/components/Sessions/CostHistoryChart.vue b/assets/js/components/Sessions/CostHistoryChart.vue index 6022e00f4..262f2aedd 100644 --- a/assets/js/components/Sessions/CostHistoryChart.vue +++ b/assets/js/components/Sessions/CostHistoryChart.vue @@ -325,10 +325,14 @@ export default defineComponent({ color: colors.muted, }, ticks: { - callback: (value: number) => - this.costType === TYPES.PRICE - ? this.fmtMoney(value, this.currency, false, true) - : this.fmtNumber(value / 1e3, 0), + callback: (value: number) => { + if (this.costType === TYPES.PRICE) { + const showDecimals = this.suggestedMaxCost < 4; + return this.fmtMoney(value, this.currency, showDecimals, true); + } else { + return this.fmtNumber(value / 1e3, 0); + } + }, color: colors.muted, maxTicksLimit: 6, },