Brian Dunning's FileMaker Custom Functions

RoundValues ( listOfValues ; precision )

Round List of Numbers

  Average rating: 4.5 (31 votes) Log in to vote

Akram   Akram
-
-

Share on Facebook Share on Twitter

  Sample input:
RoundValues (

2.345
4.464;

1)
  Sample output:
2.3
4.5

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Function will round list of values to a specified precision. Acknowledgements to VR for simplifying function.

 

Comments

comment   comment, VR
Sep 8, 2010
Couldn't this be simpler?

RoundValues ( listOfValues ; precision )

Let ( [
n = ValueCount ( listOfValues )
] ;
Round ( GetValue ( listOfValues ; 1 ) ; precision )
&
Case ( n > 1 ; ¶ & RoundValues ( RightValues ( listOfValues ; n - 1 ) ; precision ) )
)
 
Akram   Akram, comment
Sep 8, 2010
Thanks VR. I really appreciate that, I am new to custom functions and learning along the way.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.