
1. Re: Document preferences returning wrong values
[Jongware] May 18, 2010 2:22 AM (in response to Marijan Tompa [tomaxxi])(1) InDesign does not store its measurements in the format you enter (or, in this case, taken from an internal list). Everything is converted to points internally. While this reclaculating is done with 15 decimals' worth of accuracy, some rounding will always occur.
(2) InDesign uses a "double" decimal storage format. Decimals cannot be lossless stored into this format  compare it to expressing 1/3 in decimals ... The good news is, this storage format defines 52 bits for storing the decimals, and that's enough for 15 significant decimal digits. Not surprisingly, exactly the number of significant digits you got (perhaps Javascript is rigged not to return any more, as that would be meaningless).
(3) A4 is *not* exactly equal to 210 x 297 mm. A0 is defined to be exactly 1 square meter, with a length to width ratio of the square root of 0.5 (about 0.7071). Each next Astep down halves the size, so an A4 is defined to have a surface of exactly 1/16 m². Using the size ratio, that would come down to exactly (sort of) 210.22 mm x 297.302 mm, with loads and loads of less significant decimals. However, that's the official definition!

2. Re: Document preferences returning wrong values
Marijan Tompa [tomaxxi] May 18, 2010 3:00 AM (in response to [Jongware])Hey!
Thanks on your explanation, but...
Then why my margin values are correct if all is converted to points?Second and third answer is I think not an issue here.
It's internal bug of InDesign.
I just tried to enter values for example: 298 x 211 mm,
and in script values are correct, without decimals.
So, where is the problem?
If you have some time, just try it...
Use standard A4 from page sizes...
tomaxxi

3. Re: Document preferences returning wrong values
Marijan Tompa [tomaxxi] May 18, 2010 3:03 AM (in response to Marijan Tompa [tomaxxi])Hey!
I just found here is the problem!
If you select predefined sizes, you get decimal values,
but if you enter size manualy, then all is ok.
So, It's bug in InDesign...
tomaxxi