GetAsDouble ( text )
Return text as a double precision floating-point number with 16 digits to the right of the decimal point. Useful when comparing field values to variables, because Decimals are stored with higher precision in fields than in variables.
Be the first to rate this function Log in to vote
Marcus Nilsson - Show more from this author
Square Moon https://www.squaremoon.se/ |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
/**
* ==================================================================
* GetAsDouble ( text )
*
* PARAMETERS:
* text
* RETURNS:
* (double) Double precision floating-point number with 16 digits to the right of the decimal point
* SETS:
* none
* EXAMPLE:
* GetAsDouble ( 0,33333333333333333 ) = 0,3333333333333333
* DEPENDENCIES:
* GetAsNumber ( text )
* SetPrecision ( expression ; precision )
* AUTHOR:
* Marcus Nilsson, Square Moon Industries AB, marcus@squaremoon.se
* PURPOSE:
* Return text as a double precision floating-point number with 16 digits to the right of the decimal point. Useful when comparing field values to variables, because Decimals are stored with higher precision in fields than in variables.
* NOTES:
* none
* REVISIONS:
* 2019-10-08, Marcus Nilsson. Created.
* 2019-10-09, Marcus Nilsson. Replaced "SetPrecision ( expression ; precision )" with "Truncate ( number ; precision )" for better clarity.
* ==================================================================
*
*/
Truncate ( GetAsNumber ( text ) ; 16 )
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.