Re: [Cbor] Money amounts

Richter, Jörg <Joerg.Richter@pdv-FS.de> Mon, 25 February 2019 11:07 UTC

Return-Path: <Joerg.Richter@pdv-FS.de>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5CB6F12D4E6 for <cbor@ietfa.amsl.com>; Mon, 25 Feb 2019 03:07:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.921
X-Spam-Level:
X-Spam-Status: No, score=-0.921 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FROM_EXCESS_BASE64=0.979] autolearn=no autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zl6lhXLEq1Bx for <cbor@ietfa.amsl.com>; Mon, 25 Feb 2019 03:07:00 -0800 (PST)
Received: from mail.pdv-fs.de (mail.pdv-fs.de [213.208.220.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E7B10127287 for <cbor@ietf.org>; Mon, 25 Feb 2019 03:06:59 -0800 (PST)
Received: from EXCHDB1.pdv-fs.de (192.168.180.94) by EXCHDB1.pdv-fs.de (192.168.180.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 25 Feb 2019 12:06:57 +0100
Received: from EXCHDB1.pdv-fs.de ([fe80::6c4a:8b1b:60f4:4437]) by EXCHDB1.pdv-fs.de ([fe80::6c4a:8b1b:60f4:4437%15]) with mapi id 15.01.1466.012; Mon, 25 Feb 2019 12:06:57 +0100
From: "Richter, Jörg" <Joerg.Richter@pdv-FS.de>
To: Changaco <changaco=40changaco.oy.lc@dmarc.ietf.org>, Carsten Bormann <cabo@tzi.org>
CC: "cbor@ietf.org" <cbor@ietf.org>
Thread-Topic: [Cbor] Money amounts
Thread-Index: AQHUzOx92SDKrErmaU2DctY4qiZ6Z6XwMeIAgAARnwCAABUloA==
Date: Mon, 25 Feb 2019 11:06:57 +0000
Message-ID: <f2fde9b2c8f54d9691b0933e7818b90c@pdv-FS.de>
References: <20190225102821.583b57b9.changaco@changaco.oy.lc> <A996325B-9D87-4537-87B4-59CD40F56FF2@tzi.org> <20190225114418.5eaea1dd.changaco@changaco.oy.lc>
In-Reply-To: <20190225114418.5eaea1dd.changaco@changaco.oy.lc>
Accept-Language: de-DE, en-US
Content-Language: de-DE
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [192.168.180.93]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/V7Uc91QTZ2CqnJmMxeoiQ2mlNYg>
Subject: Re: [Cbor] Money amounts
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Feb 2019 11:07:02 -0000

> > (I’m not a big fan of having to parse the string version of 77111, but
> if that string style is important to your application, that’s not
> relevant.)
> 
> It's not really important, I added it mostly because for some "small"
> amounts it can actually be shorter than other formats.
> 
> For example `"EUR10.00"` takes up 9 bytes whereas `["EUR", 10.00]` uses 11
> bytes when the number is encoded as a decimal fraction (tag 4).

And I'm not a big fan of encoding additional information in the number of 
decimal places.  So "EUR10.00" should be transmitted as "EUR10", or ["EUR",10].
But for other decimal fractions you are right that the string might be shorter.

Isn't this a use case for the additional attributes map?  To encode the 
number of decimal places that should be used (e.g. for display).  What
other applications do you have in mind for the attribute map?
Can some common attributes be included in the proposal?

If there is consensus I can include your extensions into my proposal for tag 165.

- Jörg