Changeset 01b538c in rattail
- Timestamp:
- 07/08/2022 12:48:39 PM (7 months ago)
- Branches:
- master
- Children:
- b5688a0
- Parents:
- a732a76c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rattail/pricing.py
ra732a76c r01b538c 3 3 # 4 4 # Rattail -- Retail Software Framework 5 # Copyright © 2010-20 19Lance Edgar5 # Copyright © 2010-2022 Lance Edgar 6 6 # 7 7 # This file is part of Rattail. … … 26 26 27 27 from __future__ import unicode_literals, absolute_import 28 29 30 __all__ = ['gross_margin']31 28 32 29 … … 59 56 return margin 60 57 return 100 * margin 58 59 60 def calculate_markup(margin): 61 """ 62 Calculate the "markup" value corresponding to the given margin. 63 64 :param margin: Profit margin as decimal percentage (e.g. between 65 0.0 and 1.0). 66 67 :returns: Equivalent cost markup as decimal value (e.g. 1.4). 68 """ 69 if margin is None: 70 return 71 if margin == 0: 72 return 1 73 74 return 1 / (1 - margin)
Note: See TracChangeset
for help on using the changeset viewer.