Re: [Cbor] Proposal for Currency and Money Amount

Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Thu, 14 February 2019 14:47 UTC

Return-Path: <jeffpc@josefsipek.net>
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 32AC1131069 for <cbor@ietfa.amsl.com>; Thu, 14 Feb 2019 06:47:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, URIBL_BLOCKED=0.001] autolearn=ham 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 CR4Y_jgZ89GA for <cbor@ietfa.amsl.com>; Thu, 14 Feb 2019 06:47:20 -0800 (PST)
Received: from smtp.jeffnet.31bits.net (josefsipek.net [71.174.113.7]) by ietfa.amsl.com (Postfix) with ESMTP id C502A13105F for <cbor@ietf.org>; Thu, 14 Feb 2019 06:47:20 -0800 (PST)
Received: from meili (unknown [172.27.0.10]) by smtp.jeffnet.31bits.net (Postfix) with ESMTPSA id F0038261C3; Thu, 14 Feb 2019 14:47:19 +0000 (UTC)
Date: Thu, 14 Feb 2019 09:47:19 -0500
From: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
To: "Richter, Jörg" <Joerg.Richter@pdv-FS.de>
Cc: "cbor@ietf.org" <cbor@ietf.org>
Message-ID: <20190214144719.GA1404@meili>
References: <41655d71b9414fb7891487d0123e1b61@pdv-FS.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <41655d71b9414fb7891487d0123e1b61@pdv-FS.de>
User-Agent: Mutt/1.10.1 (2018-07-13)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/db-tIb_kuFblu3S9Wlt7MneoKlQ>
Subject: Re: [Cbor] Proposal for Currency and Money Amount
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: Thu, 14 Feb 2019 14:47:23 -0000

On Thu, Feb 14, 2019 at 08:31:10 +0000, Richter, Jörg wrote:
> Here is a proposal to assign tags to currency and money amount:
> https://j-richter.github.io/CBOR/currency.html

Should this support non-decimal currency amounts?

As far as I can tell, the only currently in use non-decimal currency is the
Mauritania's ouguiya (ISO 4217: MRU & 929) which uses 1 ouguiya = 5 khoums [1].

There are a number of historical currencies that were non-decimal, but I
suppose most (all?) of them are irrelevant since they don't have an ISO code.

(I suppose the simplest solution to allowing non-decimal currencies would be
to make the array 2 or more elements.  The currency code tells the consumer
how to render the encoded values.)

Thanks,

Jeff, who doesn't actually have a use for non-decimal currency support in CBOR.

[1] https://en.wikipedia.org/wiki/Non-decimal_currency#Contemporary_non-decimal_currencies

> I have used tags 164/165. Code 164 is “CURRENCY SIGN” in Latin1. Not that it matters.
> I think there is no reason to use shorter tags here, as currencies are
> rarely transferred/saved alone.
> Amounts of money are long enough that no shorter tag is worth it.
> 
> It is possible to use only one tag for both applications. But I think the
> semantic difference is big enough that two tags are justified.
> 
> 

> _______________________________________________
> CBOR mailing list
> CBOR@ietf.org
> https://www.ietf.org/mailman/listinfo/cbor


-- 
Fact: 23.6% of all statistics are generated randomly.