Click the "Download" button below to retrieve a copy of this tag,
including the complete documentation and sample usage shown
on this page. Place the downloaded ".inc" file in your
LassoStartup folder, restart Lasso, and you can begin using this
tag immediately.
[
define_tag:'lp_math_percentage',
-description='Returns the percentage value given the part and the total.',
-priority='replace',
-required='part',
-required='total',
-optional='precision';
// did we get a precision?
if:!(local_defined:'precision');
// nope, set it to zero
local:'precision' = 0;
/if;
// return the percentage
return: (lp_decimal_precisionSet: (decimal: (decimal:#part) / (decimal:#total) * (decimal:100)), (integer:#precision));
/define_tag;
]