Re: [Cbor] Proposal for Currency and Money Amount

Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Fri, 15 February 2019 12:08 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 E0EDB130FA8 for <cbor@ietfa.amsl.com>; Fri, 15 Feb 2019 04:08:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] 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 rnzgA3sEACxa for <cbor@ietfa.amsl.com>; Fri, 15 Feb 2019 04:08:09 -0800 (PST)
Received: from smtp.jeffnet.31bits.net (josefsipek.net [71.174.113.7]) by ietfa.amsl.com (Postfix) with ESMTP id A3D4D130E73 for <cbor@ietf.org>; Fri, 15 Feb 2019 04:08:09 -0800 (PST)
Received: from meili (unknown [172.27.0.10]) by smtp.jeffnet.31bits.net (Postfix) with ESMTPSA id 6E12C26B3A; Fri, 15 Feb 2019 12:08:08 +0000 (UTC)
Date: Fri, 15 Feb 2019 07:08:07 -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: <20190215120807.GA1351@meili>
References: <41655d71b9414fb7891487d0123e1b61@pdv-FS.de> <20190214144719.GA1404@meili> <cc7d04e6db734627875e537d4b83ee49@pdv-FS.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <cc7d04e6db734627875e537d4b83ee49@pdv-FS.de>
User-Agent: Mutt/1.10.1 (2018-07-13)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/uUHvx2xnsaPY_9NghHo7e_Pm8fw>
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: Fri, 15 Feb 2019 12:08:12 -0000

On Fri, Feb 15, 2019 at 08:04:13 +0000, Richter, Jörg wrote:
> > 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
> > ...
> > (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.)
> 
> I would be very surprised if software would store values of this
> currency not with fractions 0.0, 0.2, 0.4, 0.6 or 0.8.
> 
> Many calculations with amounts also use more decimal places than
> the currency defines.  So there is a need to store a fraction of the smallest unit.
> One daily live example would be petrol prices in Germany that have 3 decimal 
> places instead of the 2 that the Euro defines.  
> Some applications even require non-decimal fractions like 1/3.
> 
> This is of course representable with just one number.

Yeah, that's fair.  The pre-decimal "GBP" which, according to wikipedia, was
'divided into 20 shillings and each shilling into 12 pence, making 240 pence
to the pound' would be much harder to wedge into a "one number format".

Given the use of ISO 4217, I'm happy with the proposal as is (for whatever
it's worth) without having explicit support for historical currencies.

Jeff.

-- 
Reality is merely an illusion, albeit a very persistent one.
		- Albert Einstein