Lasso Soft Inc. > Home

[lp_decimal_float]

Linklp_decimal_float
AuthorBil Corry
CategoryMath
Version8.x
LicensePublic Domain
Posted12 Feb 2006
Updated12 Feb 2006
More by this author...

Description

Returns the floating part of a given decimal number.
Requires [lp_decimal_precisionset]

Sample Usage

lp_decimal_float: lp_math_pi;'
'; // returns: 0.1415926535897

Source Code

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_float',
	-description='Returns the floating part of a given decimal number.',
	-priority='replace',
	-required='decimal';
	local:'return' = (string: (lp_decimal_precisionset:(decimal: #decimal)))->(split:'.');
	if: #return->size == 1;
		return: decimal: 0.0;
	else;
		return: (lp_decimal_precisionset:(decimal: '0.' #return->(get:2)));
	/if;

/define_tag;

]

Related Tags

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft