[Top][All Lists]

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

Re: [Taler] (docs) Amount vs ParsedAmount

From: Florian Dold
Subject: Re: [Taler] (docs) Amount vs ParsedAmount
Date: Wed, 24 Mar 2021 17:02:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

Hi ttn,

the ParsedAmount is deprecated. All amounts in Taler are represented as strings.

- Florian

On 3/23/21 5:44 PM, Thien-Thi Nguyen wrote:

I see that there are two types, ‘Amount’ and ‘ParsedAmount’,
defined in api-common.rst.  There is also the blurb:

  // For example, a fraction
  // of 50,000,000 would correspond to 50 cents.

(in the ‘ParsedAmount’ explanation for field ‘fraction’).

My understanding is that when i write ‘Amount’ "EUR:1.50", that
corresponds to (becomes, after parsing) the ‘ParsedAmount’

    "currency": "EUR",
    "value": 1,
    "fraction": 50000000

That is, the ".50" portion of ‘Amount’ is textually "zero-
extended" to eight digits before applying some kind of ‘atol’

My questions are:

(a) Is that correct?
(b) For future reference, where can i find this in the source?
     (Which repo?)

reply via email to

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