Subject: [Jcardcal] Integers in jCard

From: Bert Greevenbosch <[email-masked]>
Date: Fri, 30 Aug 2013 02:12:29 +0000

Hi all,

The following comment from Barry needs some reflection:

<QUOTE>

In Section 3.4.9:

    The value elements are JSON primitive number values.

Are "1000.0" and "1E3" valid representations of integer values? If so, that's
fine. If not, I think you need to say "JSON primitive number values without
fraction or exponent parts."

Similar question about exponents in Section 3.4.10. In either case, if
exponents are allowed, you should warn about removing them when converting back
to vCard.

</QUOTE>

Indeed JSON doesn't really make a distinction between "float" and "int". Instead, it has a general "number" data type, which can contain decimals and exponents.

To me, it seems impractical to forbid using decimals and exponents for jCard integers. A general JSON parser (which is oblivious of jCard) would ignore any such requirement anyway.

So I guess it would be better to describe what to do with decimals and exponents when converting to vCard. Maybe we can add the following text to section 3.4.9 (after the example):

BEGIN
  Note: Neither JSON nor jCard prohibits using a combination of decimals and 
  exponents to form an integer number. However, since vCard does not support 
  decimals or exponents in integers, any decimals and exponents MUST be 
  eliminated when converting an "integer" value type property from jCard to 
  vCard.
END;

Feedback is highly appreciated!

Best regards,
Bert

---

From: Michael Angstadt <[email-masked]>
Date: Fri, 30 Aug 2013 08:58:58 -0400

On Thu, Aug 29, 2013 at 10:12 PM, Bert Greevenbosch <
[email-masked]> wrote:

> To me, it seems impractical to forbid using decimals and exponents for
> jCard integers. A general JSON parser (which is oblivious of jCard) would
> ignore any such requirement anyway.

Agreed.  A similar statement should be added to the "float" section
(3.4.10) about permitting exponents to be used.

BEGIN
  Note: Neither JSON nor jCard prohibits using exponents to form
  a float number. However, since vCard does not support
  exponents in floats, any exponents MUST be eliminated when
  converting a "float" value type property from jCard to vCard.
END;

Perhaps these changes should be applied to the jCal draft as well, since
jCal also defines "integer" and "float" data types.