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.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: