Link | lp_decimal_precisionSet |
Author | Bil Corry |
Category | Math |
Version | 8.x |
License | Public Domain |
Posted | 21 Nov 2005 |
Updated | 05 Dec 2005 |
More by this author... |
Returns a decimal number formatted to the specified precision. If precision is omitted, the default is to show all significant digits.
Note: Requires [lp_decimal_precisionGet]
[lp_decimal_precisionSet: 9.12345, 3] Returns: 9.123
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; ]
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft