本文整理汇总了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
示例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
示例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
示例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
)
示例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
示例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
)
示例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
示例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
)
示例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
示例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)
示例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']
)
示例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']
)
示例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']
)
示例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']
)
示例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']
)