本文整理汇总了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;未经允许,请勿转载。 |
请发表评论