XBRL中@decimals和@precision处理,陷阱

XBRL规范中说明,可以有@decimals + Item的值 计算的相应的 @precision值。

而在验证计算链接库时,都应该按照precision调整(Round)后进行比较,判断计算链接库是否平衡。

( If, on a numeric item, the decimals attribute is present rather than the precision attribute, then a consuming application MUST infer the precision of that numeric fact if it is to be used in calculations or searches for duplicates in XBRL instances. )

 

但是今天碰到这样的问题。

<A decimals="2">0.0012</A>

根据规范推导 precision = X.decimas + Y.小数点前的有效位数() + E.指数。

Y = (

if there are non-zero digits to the left of the decimal point or implied decimal point if absent then the number of digits excluding any leading zeros to the left of the decimal point (or implied decimal point if absent) in the lexical representation of the numerical fact

otherwise if there are non-zero digits to the right of the decimal point, the negative of the number of zeros between the decimal point and the first non-zero digit in the lexical representation of the numerical fact

)

得到 @precision=0 (2 + -2) ,而当@precision=0时,数据是不可比的。

Precision

Example of lexical represen­tation in the XBRL instance

Read as (after omitting or zeroing any spuri-ous digits)

Known to be GE

Known to be LT

INF

476.334

476.334

476.334

476.33400000000…1

3

205

205e0

204.5

205.5

4

2002000

2002e3

2001500

2002500

4

-2002000

-2002e3

-2002500

2001500

2

2012

20e2

1950

2050

2

2000

20e2

1950

2050

1

99

9e1

85

95

0

1234

1234

unknown

unknown

 

但是我们会说,A明明是0嘛(根据小数位数判断),为什么有变成0.0012了呢。且不可比。

这似乎和实际不是很符合。不好理解。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值