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_decimal_precisionSet',
-description='Returns a decimal number formatted to the specified precision.',
-priority='replace',
-required='number', -copy,
-optional='precision';
// make sure number is a decimal
#number = decimal: #number;
// did we get a precision?
if:!(local_defined:'precision');
// nope, set it to show all significant digits
local:'precision' = (lp_decimal_precisionGet: #number);
/if;
// format the number
#number->(setformat: -precision=(integer:#precision));
// return
return: #number;
/define_tag;
]