Monday, December 27, 2010

Precision Inference Code Checked In

I have just checked in code that implements section 4.6.6 (“Inferring Precision”) of the XBRL specification. I used the technique that I mentioned in my last post to unit test the code, and all seven examples given in section 4.6.6 have been implemented as unit tests and all examples pass.

This work adds the following properties to the Fact class:

  • bool DecimalsSpecified: This property evaluates to true if the fact was specified in the XBRL fragment with a decimals attribute value and false otherwise.
  • bool PrecisionSpecified: This property evaluates to true if the fact was specified in the XBRL fragment with a precision attribute value and false otherwise.
  • int Precision: This property specifies the number of significant figures to be assumed to be correct in calculations involving the fact’s values.
  • bool PrecisionInferred: This property evaluates to true if the precision of the fact was calculated using the rules in section 4.6.6 of the XBRL specification and false otherwise.

If the value of the PrecisionInferred property is true, then the value of PrecisionSpecified will be false, and the value of the Precision property can assumed to be calculated in accordance with the rules in section 4.6.6 of the XBRL spec. If the value of the PrecisionInferred property is false, then the value of PrecisionSpecified will be true, and the value of the Precision property can assumed to be specified in the XBRL fragment through the precision attribute on the fact’s element.

No comments:

Post a Comment