Link | FormatAccounting |
Author | Justin Dennis |
Category | String |
Version | 7.x |
License | Public Domain |
Posted | 13 Oct 2006 |
Updated | 13 Oct 2006 |
More by this author... |
This tag easily displays any decimal in an accounting format similar to that used by Microsoft Excel. Negative numbers are enclosed in parenthesis and positive numbers are padded left and right with space equal to the space taken up by parenthesis. It's designed to be used with a font such as Verdana or other fixed-width font so that decimal points line up correctly when positive and negative numbers are displayed in a column.
[Var: 'myDecimal' = decimal('-1234.56')] [FormatAccounting: $myDecimal] -> (1,234.56)
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.
setformat(-groupchar=',', -precision='2'); if(#new_amount < 0); return('(' + string_removeleading(#new_amount, -pattern='-') + ')'); else; return('' + string(#new_amount) + ' '); /if; /define_tag; ?>
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft