gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-docs] branch master updated: Add dd51


From: gnunet
Subject: [taler-docs] branch master updated: Add dd51
Date: Mon, 02 Oct 2023 18:21:30 +0200

This is an automated email from the git hooks/post-receive script.

marc-stibane pushed a commit to branch master
in repository docs.

The following commit(s) were added to refs/heads/master by this push:
     new e1b0ab6a Add dd51
e1b0ab6a is described below

commit e1b0ab6a6b47c290d75eb00b1c3f164bd6607b5e
Author: Marc Stibane <marc@taler.net>
AuthorDate: Mon Oct 2 18:21:20 2023 +0200

    Add dd51
---
 design-documents/051-fractional-digits.rst | 62 ++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/design-documents/051-fractional-digits.rst 
b/design-documents/051-fractional-digits.rst
new file mode 100644
index 00000000..ff9d0fe2
--- /dev/null
+++ b/design-documents/051-fractional-digits.rst
@@ -0,0 +1,62 @@
+DD 51: Fractional Digits
+###############
+
+Summary
+=======
+
+This design document specifies how an amount's fractional digits should be 
rendered.
+
+Motivation
+==========
+
+Since different currencies have different ways to show/render fractionals, the 
end-user apps should follow these guidelines.
+
+Requirements
+============
+
+There is already a specification for ScopedCurrencyInfo - this needs to change
+
+We need three characteristics for fractional digits for each currency:
+
+a) the number of fractional digits [0..8] the user may enter in a 
TextInputField
+
+b) the number of fractional digits [0..8] to be rendered as normal characters 
(same font and size as the integer digits).
+   All additional fractional digits will be rendered as SuperScriptDigits as 
known from gas filling stations.
+   The UI should never round or truncate any amount, but always render all 
existing digits (except trailing zeroes, see c).
+
+c) the number of fractional digits [0..8] to be rendered as trailing zeroes 
(including SuperScript digits).
+   E.g. if this is 2 (and normal == 2), then render $5 as “$ 5.00”.
+   If this is 3 (and normal == 2), then render $5 as “$ 5.00⁰” with two normal 
trailing zeroes and one superscript trailing zero.
+
+Usually, all these three numbers have the same value, which means that in case 
of e.g. “2” (used for €,$,£) the user can enter cent/penny values (but not a 
fraction of those), these cents/pennies are always shown (even if they are 0) 
as two normal digits after the decimal separator, and fractions of a cent/penny 
are rendered as SuperScriptDigits, but only if they are not trailing zeroes.
+
+
+Proposed Solution
+=================
+
+public struct ScopedCurrencyInfo: Codable, Sendable {
+    let decimalSeparator: String                // e.g. “.” for $ and ¥; “,” 
for €
+    let numFractionalInputDigits: Int           // how much digits the user 
may enter after the decimalSeparator
+    let numFractionalNormalDigits: Int          // €,$,£: 2; some arabic 
currencies: 3, ¥: 0
+    let numFractionalTrailingZeroDigits: Int    // usually same as 
numFractionalNormalDigits, but e.g. might be 2 for ¥
+    let isCurrencyNameLeading: Bool             // true for “$ 3.50”; false 
for “3,50 €”
+}
+
+
+Definition of Done
+==================
+
+(Only applicable to design documents that describe a new feature.  While the
+DoD is not satisfied yet, a user-facing feature **must** be behind a feature
+flag or dev-mode flag.)
+
+Alternatives
+============
+
+Drawbacks
+=========
+
+Discussion / Q&A
+================
+
+(This should be filled in with results from discussions on mailing lists / 
personal communication.)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]