XBRL 规范中事实数据 Item有@decimals属性,在计算链接库处理,是根据@decimals属性Rounding后,在计算的;
而Formula处理时,是不考虑数据的@decimals属性的。考虑一种情况。
A = B + C
A @deicmals=0 100.09
B @decimals=0 60.00
C @decimals=0 40.00
计算链接库,验证是通过。但是Formula验证,如何直接使用等号,验证的话 100.09 != 60+ 40
如果考虑: A - (B + C) <= 10 ^ (-1 * A.decimals) / 2
100.09 - 100 <= 10 ^ (0) /2 <= 0.5
因此在写Formula断言时,如果使用值断言是需要考虑比较值的小数位数;如果使用一致性断言,某些情况下,可以自动按照目标fact Rounding(忘了)后比较。
If the two facts have data types that are numeric, and their data types are not xbrli:fractionItemType or derived from the xbrli:fractionItemType, and the acceptance radius is not defined, then they are only consistent if the numeric values A and B are x-equal where A is obtained by rounding the value of the first fact to N significant figures and B is obtained by rounding the value of the second fact to N significant figures noting that N is the lower of the specified or inferred precision for the first fact and the specified or inferred precision for the second fact.
为什么不按照最小的@decimals属性来判断呢? XBRL规范推荐使用@decimals属性。