From 0fba52f3e7c5507753d5262e9ef60f8666ca8180 Mon Sep 17 00:00:00 2001 From: safavimohadeseh78 Date: Sun, 1 Nov 2026 19:30:03 +0330 Subject: [PATCH] fix(convert): keep units before amounts in the copper calculator Co-authored-by: Cursor --- .../components/CopperConvertCalculator.vue | 70 +++++++++++-------- .../composables/useCopperConvertPage.ts | 3 +- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/src/views/base/convert/components/CopperConvertCalculator.vue b/src/views/base/convert/components/CopperConvertCalculator.vue index df16358..47da9e3 100644 --- a/src/views/base/convert/components/CopperConvertCalculator.vue +++ b/src/views/base/convert/components/CopperConvertCalculator.vue @@ -21,7 +21,10 @@ :class="{ 'copper-convert__chip--muted': row.missing }" > {{ row.label }} - {{ row.value }} + + {{ row.unit }} + {{ row.value }} + @@ -35,7 +38,10 @@ class="copper-convert__chip copper-convert__chip--accent" > {{ row.label }} - {{ row.value }} + + {{ row.unit }} + {{ row.value }} + @@ -60,12 +66,12 @@
-
- {{ formatAssetAmount(sliderAmount) }} +
+ {{ formatAssetAmount(sliderAmount) }} {{ assetUnit }}

- +

۰ - {{ formatAssetAmount(assetAmount) }} {{ assetUnit }} + {{ assetUnit }}{{ formatAssetAmount(assetAmount) }}
@@ -98,12 +104,12 @@
- ۱.۵ mm² + ۱.۵ mm²

{{ formatRings(result.rings15ByValue) }}

حلقه سیم

- ۲.۵ mm² + ۲.۵ mm²

{{ formatRings(result.rings25ByValue) }}

حلقه سیم

@@ -112,11 +118,11 @@
ارزش معادل - {{ formatRial(result.totalValueRial) }} ریال + ریال{{ formatRial(result.totalValueRial) }}
معادل مفتول - {{ formatKg(result.equivalentMaftoulKg) }} کیلو + کیلو{{ formatKg(result.equivalentMaftoulKg) }}
@@ -127,13 +133,13 @@ تقسیم بین دو سیم

- مانده {{ formatAssetAmount(remainderAmount) }} {{ assetUnit }} است. هر زبانه فقط عدد صحیح حلقه است؛ اعشاری که به یک حلقه نرسد در دارایی می‌ماند. + مانده {{ assetUnit }}{{ formatAssetAmount(remainderAmount) }} است. هر زبانه فقط عدد صحیح حلقه است؛ اعشاری که به یک حلقه نرسد در دارایی می‌ماند.

- -
- {{ wire15Rings }} + +
+ {{ wire15Rings }} عدد حلقه
۰ - {{ maxRings15 }} عدد حلقه + عدد حلقه{{ maxRings15 }}
- -
- {{ wire25Rings }} + +
+ {{ wire25Rings }} عدد حلقه
۰ - {{ maxRings25 }} عدد حلقه + عدد حلقه{{ maxRings25 }}

- اعشار مانده: {{ formatAssetAmount(leftoverAmount) }} {{ assetUnit }} نگه داشته می‌شود. + اعشار مانده: {{ assetUnit }}{{ formatAssetAmount(leftoverAmount) }} نگه داشته می‌شود.

({ label, - value: amount > 0 ? `${Math.round(amount).toLocaleString('en-US')} ریال` : '—', + value: amount > 0 ? Math.round(amount).toLocaleString('en-US') : '—', + unit: amount > 0 ? 'ریال' : '', missing: amount <= 0, }) return [