TotalList ( valueList )
Get the total of all number values of a given list
Average rating: 4.4 (30 votes) Log in to vote
SL - Show more from this author
ITC |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
All the credits to Mr Geoff Wells (http://www.dataisland.com) who had written the original one.
Because the use of LeftWords() and RightWords() Geoff's CF was not able to properly add any numbers less than 1 to the total.
For example: TotalList (".11¶.22¶1") returned as result 34 instead of 1.33
Now TotalList (".11¶.22¶1") returns 1.33
Why the old CF was wrong?
LeftWords() and Rightwords() use not-alphanumeric chars as word's separators so:
LeftWords(".11¶.22¶1" ; 1) returns "11".
LeftValues(".11¶.22¶1" ; 1) instead returns .11
Comments
Rob Westergaard, Davis, CA Feb 8, 2010 |
||
Is there a situation where the following non-recursive function wouldn't accomplish the same task? Evaluate ( "Sum ( GetAsNumber ( \"" & Substitute ( valueList ; "¶" ; "\" ) ; GetAsNumber ( \"" ) & "\" ) )" ) |
||
rivet, TO Mar 18, 2011 |
||
Does not handle negative numbers | ||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.