percent->value
Use the [percent->value] method to return the decimal value of the percent, which may be used in calculations.
This example uses the [percent->value] method to calculate the sale price of an item at different discounts.
Code
var( discounts = array( percent(.1), percent(.13), percent(.05), percent(.2) ),
itemPrice = 35.00 )
with d in $discounts
do => {^
local( salePrice = currency($itemPrice - $itemPrice*#d->value))
'At '+#d+' off: '+#salePrice+'\n'
^}
Result
At 10% off: $31.50 At 13% off: $30.45 At 5% off: $33.25 At 20% off: $28.00
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments