本文整理汇总了Python中arelle.XbrlConst.isIntegerXsdType方法的典型用法代码示例。如果您正苦于以下问题:Python XbrlConst.isIntegerXsdType方法的具体用法?Python XbrlConst.isIntegerXsdType怎么用?Python XbrlConst.isIntegerXsdType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类arelle.XbrlConst
的用法示例。
在下文中一共展示了XbrlConst.isIntegerXsdType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ebaDecimals
# 需要导入模块: from arelle import XbrlConst [as 别名]
# 或者: from arelle.XbrlConst import isIntegerXsdType [as 别名]
def ebaDecimals(locale, value, concept, defaultDecimals):
'''
:type locale: dict
:type value: string
:type concept: ModelConcept
:type defaultDecimals: str
:rtype (boolean, str)
'''
isPercent = concept.typeQname == qnPercentItemType
isInteger = XbrlConst.isIntegerXsdType(concept.type.baseXsdType)
isMonetary = concept.isMonetary
decimalsFound, decimals = decimalsComputer(locale, value, concept, defaultDecimals)
if not(decimalsFound) or decimals == 'INF':
return (decimalsFound, decimals)
else:
# the default values are for non-monetary items
lowerBound = -20
upperBound = 20
decimalsAsInteger = int(decimals)
if isMonetary:
lowerBound = -3
elif isInteger:
lowerBound = upperBound = 0
elif isPercent: # percent values
lowerBound = 4
upperBound = 20
if decimalsAsInteger<lowerBound:
decimals = str(lowerBound)
decimalsAsInteger = lowerBound
if decimalsAsInteger>upperBound:
decimals = 'INF' # approximation
decimalsAsInteger = upperBound
return (decimalsFound, decimals)