commit 83be421e7f194a7bcf8c26850ff4b0f1077042a3
parent edf855f3c46c2aa0ed97c4a08d4f46e7aaed922c
Author: Vlada Svirsh <svirv1@bfh.ch>
Date: Wed, 29 Oct 2025 15:00:13 +0100
DD72 tables fix
Diffstat:
1 file changed, 221 insertions(+), 221 deletions(-)
diff --git a/design-documents/072-products-units.rst b/design-documents/072-products-units.rst
@@ -72,200 +72,200 @@ Proposed Solution
``unit_precision_level`` = 0, and both default labels (long/short) echo the
merchant-supplied string.
- .. list-table:: Default backend policies
- :widths: 20 10 10 30 30
- :header-rows: 1
-
- * - BackendStr
- - Type
- - Precision
- - Default label (long)
- - Default label (short)
- * - Piece
- - int
- - 0
- - piece
- - pc
- * - Set
- - int
- - 0
- - set
- - set
- * - SizeUnitCm
- - float
- - 1
- - centimetre
- - cm
- * - SizeUnitDm
- - float
- - 3
- - decimetre
- - dm
- * - SizeUnitFoot
- - float
- - 3
- - foot
- - ft
- * - SizeUnitInch
- - float
- - 2
- - inch
- - in
- * - SizeUnitM
- - float
- - 3
- - metre
- - m
- * - SizeUnitMm
- - int
- - 0
- - millimetre
- - mm
- * - SurfaceUnitCm2
- - float
- - 2
- - square centimetre
- - cm²
- * - SurfaceUnitDm2
- - float
- - 3
- - square decimetre
- - dm²
- * - SurfaceUnitFoot2
- - float
- - 3
- - square foot
- - ft²
- * - SurfaceUnitInch2
- - float
- - 4
- - square inch
- - in²
- * - SurfaceUnitM2
- - float
- - 4
- - square metre
- - m²
- * - SurfaceUnitMm2
- - float
- - 1
- - square millimetre
- - mm²
- * - TimeUnitDay
- - float
- - 3
- - day
- - d
- * - TimeUnitHour
- - float
- - 2
- - hour
- - h
- * - TimeUnitMinute
- - float
- - 3
- - minute
- - min
- * - TimeUnitMonth
- - float
- - 2
- - month
- - mo
- * - TimeUnitSecond
- - float
- - 3
- - second
- - s
- * - TimeUnitWeek
- - float
- - 3
- - week
- - wk
- * - TimeUnitYear
- - float
- - 4
- - year
- - yr
- * - VolumeUnitCm3
- - float
- - 3
- - cubic centimetre
- - cm³
- * - VolumeUnitDm3
- - float
- - 5
- - cubic decimetre
- - dm³
- * - VolumeUnitFoot3
- - float
- - 5
- - cubic foot
- - ft³
- * - VolumeUnitGallon
- - float
- - 3
- - gallon
- - gal
- * - VolumeUnitInch3
- - float
- - 2
- - cubic inch
- - in³
- * - VolumeUnitLitre
- - float
- - 3
- - litre
- - L
- * - VolumeUnitM3
- - float
- - 6
- - cubic metre
- - m³
- * - VolumeUnitMm3
- - float
- - 1
- - cubic millimetre
- - mm³
- * - VolumeUnitOunce
- - float
- - 2
- - fluid ounce
- - fl oz
- * - WeightUnitG
- - float
- - 1
- - gram
- - g
- * - WeightUnitKg
- - float
- - 3
- - kilogram
- - kg
- * - WeightUnitMg
- - int
- - 0
- - milligram
- - mg
- * - WeightUnitOunce
- - float
- - 2
- - ounce
- - oz
- * - WeightUnitPound
- - float
- - 3
- - pound
- - lb
- * - WeightUnitTon
- - float
- - 3
- - metric tonne
- - t
- * - **Custom**
- - int
- - 0
- - *merchant string*
- - *merchant string*
+.. list-table:: Default backend policies
+ :widths: 20 10 10 30 30
+ :header-rows: 1
+
+ * - BackendStr
+ - Type
+ - Precision
+ - Default label (long)
+ - Default label (short)
+ * - Piece
+ - int
+ - 0
+ - piece
+ - pc
+ * - Set
+ - int
+ - 0
+ - set
+ - set
+ * - SizeUnitCm
+ - float
+ - 1
+ - centimetre
+ - cm
+ * - SizeUnitDm
+ - float
+ - 3
+ - decimetre
+ - dm
+ * - SizeUnitFoot
+ - float
+ - 3
+ - foot
+ - ft
+ * - SizeUnitInch
+ - float
+ - 2
+ - inch
+ - in
+ * - SizeUnitM
+ - float
+ - 3
+ - metre
+ - m
+ * - SizeUnitMm
+ - int
+ - 0
+ - millimetre
+ - mm
+ * - SurfaceUnitCm2
+ - float
+ - 2
+ - square centimetre
+ - cm²
+ * - SurfaceUnitDm2
+ - float
+ - 3
+ - square decimetre
+ - dm²
+ * - SurfaceUnitFoot2
+ - float
+ - 3
+ - square foot
+ - ft²
+ * - SurfaceUnitInch2
+ - float
+ - 4
+ - square inch
+ - in²
+ * - SurfaceUnitM2
+ - float
+ - 4
+ - square metre
+ - m²
+ * - SurfaceUnitMm2
+ - float
+ - 1
+ - square millimetre
+ - mm²
+ * - TimeUnitDay
+ - float
+ - 3
+ - day
+ - d
+ * - TimeUnitHour
+ - float
+ - 2
+ - hour
+ - h
+ * - TimeUnitMinute
+ - float
+ - 3
+ - minute
+ - min
+ * - TimeUnitMonth
+ - float
+ - 2
+ - month
+ - mo
+ * - TimeUnitSecond
+ - float
+ - 3
+ - second
+ - s
+ * - TimeUnitWeek
+ - float
+ - 3
+ - week
+ - wk
+ * - TimeUnitYear
+ - float
+ - 4
+ - year
+ - yr
+ * - VolumeUnitCm3
+ - float
+ - 3
+ - cubic centimetre
+ - cm³
+ * - VolumeUnitDm3
+ - float
+ - 5
+ - cubic decimetre
+ - dm³
+ * - VolumeUnitFoot3
+ - float
+ - 5
+ - cubic foot
+ - ft³
+ * - VolumeUnitGallon
+ - float
+ - 3
+ - gallon
+ - gal
+ * - VolumeUnitInch3
+ - float
+ - 2
+ - cubic inch
+ - in³
+ * - VolumeUnitLitre
+ - float
+ - 3
+ - litre
+ - L
+ * - VolumeUnitM3
+ - float
+ - 6
+ - cubic metre
+ - m³
+ * - VolumeUnitMm3
+ - float
+ - 1
+ - cubic millimetre
+ - mm³
+ * - VolumeUnitOunce
+ - float
+ - 2
+ - fluid ounce
+ - fl oz
+ * - WeightUnitG
+ - float
+ - 1
+ - gram
+ - g
+ * - WeightUnitKg
+ - float
+ - 3
+ - kilogram
+ - kg
+ * - WeightUnitMg
+ - int
+ - 0
+ - milligram
+ - mg
+ * - WeightUnitOunce
+ - float
+ - 2
+ - ounce
+ - oz
+ * - WeightUnitPound
+ - float
+ - 3
+ - pound
+ - lb
+ * - WeightUnitTon
+ - float
+ - 3
+ - metric tonne
+ - t
+ * - **Custom**
+ - int
+ - 0
+ - *merchant string*
+ - *merchant string*
5. **Quantity presentation in wallets and orders**
@@ -298,24 +298,27 @@ Proposed Solution
:widths: 40 30 30
:header-rows: 1
- * - kilogram (``kg``)
- - pound (``lb``)
- - 2.204 62
- * - gram (``g``)
- - ounce (``oz``)
- - 0.035 274
- * - litre (``L``)
- - fluid ounce (``fl oz``)
- - 33.814
- * - metre (``m``)
- - foot (``ft``)
- - 3.280 84
- * - square metre (``m²``)
- - square foot (``ft²``)
- - 10.763 9
- * - cubic metre (``m³``)
- - cubic foot (``ft³``)
- - 35.314 7
+ * - SI unit
+ - US/imperial unit
+ - factor
+ * - kilogram (``kg``)
+ - pound (``lb``)
+ - 2.20462
+ * - gram (``g``)
+ - ounce (``oz``)
+ - 0.035274
+ * - litre (``L``)
+ - fluid ounce (``fl oz``)
+ - 33.814
+ * - metre (``m``)
+ - foot (``ft``)
+ - 3.28084
+ * - square metre (``m²``)
+ - square foot (``ft²``)
+ - 10.7639
+ * - cubic metre (``m³``)
+ - cubic foot (``ft³``)
+ - 35.3147
* Conversions **MUST** round to the wallet's target
``unit_precision_level`` using bankers-rounding to minimise cumulative
@@ -329,16 +332,13 @@ Proposed Solution
* The original backend value **MUST** be preserved in the contract terms;
conversions are *presentation-only*.
- * Wallets **SHOULD** expose a global *numeric‑system* setting in their
+ * Wallets **SHOULD** expose a global *numeric-system* setting in their
preferences with the values ``off``, ``automatic``, ``SI``, and ``imperial``.
- * **off** – never perform unit conversions; display exactly the merchant‑supplied units.
-
- * **automatic** – apply the locale heuristic described above (imperial for ``US``, ``GB``, ``LR``, ``MM``; SI otherwise).
-
- * **SI** – always display quantities in SI units (no conversion if the merchant already uses SI).
-
- * **imperial** – always display quantities converted to imperial/US‑customary units (no conversion if the merchant already uses imperial).
+ - **off** – never perform unit conversions; display exactly the merchant-supplied units.
+ - **automatic** – apply the locale heuristic described above (imperial for ``US``, ``GB``, ``LR``, ``MM``; SI otherwise).
+ - **SI** – always display quantities in SI units (no conversion if the merchant already uses SI).
+ - **imperial** – always display quantities converted to imperial/US-customary units (no conversion if the merchant already uses imperial).
Definition of Done
==================
@@ -373,4 +373,4 @@ Drawbacks
which adds complexity compared to sending plain integers.
Discussion / Q&A
-===============
+================