• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python util.to_float_or_none函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: ticket_price_float

 def ticket_price_float(self):
     """Float value of the combined price."""
     return to_float_or_none(self._core_discount.combined)
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:3,代码来源:availability.py


示例17: total_cost_float

 def total_cost_float(self):
     """Float value of the total combined price."""
     return to_float_or_none(
         self._core_bundle.bundle_total_cost
     )
开发者ID:adamchainz,项目名称:pyticketswitch,代码行数:5,代码来源:bundle.py


示例18: price_without_surcharge_float

 def price_without_surcharge_float(self):
     """Float value of the price excluding surcharge."""
     return to_float_or_none(self._core_price_band.ticket_price)
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:3,代码来源:availability.py


示例19: surcharge_float

 def surcharge_float(self):
     """Float value of the surcharge."""
     return to_float_or_none(self._core_discount.surcharge)
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:3,代码来源:availability.py


示例20: seatprice_float

 def seatprice_float(self):
     """Float value of the seat price (i.e. without surcharge)."""
     return to_float_or_none(self._core_discount.seatprice)
开发者ID:babbageclunk,项目名称:pyticketswitch,代码行数:3,代码来源:availability.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python translit.slugify函数代码示例发布时间:2022-05-27
下一篇:
Python util.resolve_boolean函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap