当前位置: 首页>>代码示例>>Python>>正文


Python util.to_float_or_none函数代码示例

本文整理汇总了Python中pyticketswitch.util.to_float_or_none函数的典型用法代码示例。如果您正苦于以下问题:Python to_float_or_none函数的具体用法?Python to_float_or_none怎么用?Python to_float_or_none使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了to_float_or_none函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: amount_including_vat

 def amount_including_vat(self):
     """Float value of the commission including VAT"""
     if self._core_commission.amount_including_vat:
         return to_float_or_none(
             self._core_commission.amount_including_vat
         )
     return None
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:7,代码来源:base.py

示例2: non_offer_surcharge_float

    def non_offer_surcharge_float(self):
        """Float value of the full_surcharge.
        Returns None if doesn't exist.
        """

        if self._core_avail_detail.full_surcharge:
            return to_float_or_none(self._core_avail_detail.full_surcharge)

        return None
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:9,代码来源:availability.py

示例3: absolute_saving_float

    def absolute_saving_float(self):
        """Float value of the absolute_saving.
        Returns None if doesn't exist.
        """

        if self._core_avail_detail.absolute_saving:
            return to_float_or_none(self._core_avail_detail.absolute_saving)

        return None
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:9,代码来源:availability.py

示例4: non_offer_combined_float

 def non_offer_combined_float(self):
     """Float value of the original combined price (i.e. if there was no
     offer).
     """
     if self._core_price_band.combined:
         return to_float_or_none(self._core_price_band.non_offer_combined)
     else:
         return to_float_summed(
             self._core_price_band.non_offer_ticket_price, self._core_price_band.non_offer_surcharge
         )
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:10,代码来源:availability.py

示例5: min_seatprice_float

    def min_seatprice_float(self):
        """Float value of the minumum seat price."""
        fl_sp = None

        cost_range = self._get_core_cost_range()

        if cost_range:
            fl_sp = to_float_or_none(
                cost_range.min_seatprice
            )
        return fl_sp
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:11,代码来源:base.py

示例6: price_combined_float

 def price_combined_float(self):
     """Float value of the combined price."""
     if self._core_price_band.combined:
         return to_float_or_none(
             self._core_price_band.combined
         )
     else:
         return to_float_summed(
             self._core_price_band.ticket_price,
             self._core_price_band.surcharge
         )
开发者ID:graingert,项目名称:pyticketswitch,代码行数:11,代码来源:availability.py

示例7: max_combined_price_float

    def max_combined_price_float(self):
        """Float value of the maximum combined price."""
        fl_sp = None

        cost_range = self._get_core_cost_range()

        if cost_range:
            fl_sp = to_float_or_none(
                cost_range.max_combined
            )
        return fl_sp
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:11,代码来源:base.py

示例8: total_combined_float

 def total_combined_float(self):
     """Float value of the total combined price."""
     if self._core_order.total_combined:
         return to_float_or_none(
             self._core_order.total_combined
         )
     else:
         return to_float_summed(
             self._core_order.total_seatprice,
             self._core_order.total_surcharge
         )
开发者ID:adamchainz,项目名称:pyticketswitch,代码行数:11,代码来源:order.py

示例9: commission_ex_vat

    def commission_ex_vat(self):
        """Float value of the user's commission excluding VAT for
        this Concession.

        Only available if requested in get_concessions with the
        include_user_commission flag.
        """
        if self._core_discount.user_commission:

            return to_float_or_none(
                self._core_discount.user_commission.amount_inc_vat
            )

        return None
开发者ID:graingert,项目名称:pyticketswitch,代码行数:14,代码来源:availability.py

示例10: absolute_saving_float

    def absolute_saving_float(self):
        """Float value of the absolute saving."""
        ab_val = self._core_offer.get('absolute_saving', None)

        if (
            ab_val is None and
            self.full_combined_price_float is not None and
            self.offer_combined_price_float is not None
        ):
            ab_val = (
                self.full_combined_price_float -
                self.offer_combined_price_float
            )

        return to_float_or_none(ab_val)
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:15,代码来源:base.py

示例11: percentage_saving_float

 def percentage_saving_float(self):
     """Float value of the percentage saving."""
     return to_float_or_none(
         self._core_offer['percentage_saving']
     )
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:5,代码来源:base.py

示例12: offer_surcharge_price_float

 def offer_surcharge_price_float(self):
     """Float value of the offer surcharge price."""
     return to_float_or_none(
         self._core_offer['offer_surcharge']
     )
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:5,代码来源:base.py

示例13: offer_seatprice_float

 def offer_seatprice_float(self):
     """Float value of the offer seatprice price."""
     return to_float_or_none(
         self._core_offer['offer_seatprice']
     )
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:5,代码来源:base.py

示例14: offer_combined_price_float

 def offer_combined_price_float(self):
     """Float value of the offer combined price."""
     return to_float_or_none(
         self._core_offer['offer_combined']
     )
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:5,代码来源:base.py

示例15: full_seatprice_float

 def full_seatprice_float(self):
     """Float value of the full seatprice price."""
     return to_float_or_none(
         self._core_offer['full_seatprice']
     )
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:5,代码来源:base.py


注:本文中的pyticketswitch.util.to_float_or_none函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。