Brian Dunning's FileMaker Custom Functions

RoundNdecimals ( Importe ; NumDecimales )

Round to a variable decimal number and add the corresponding zeros to the right

  Be the first to rate this function Log in to vote

Miguel Angel Aguerrea   Miguel Angel Aguerrea - Show more from this author
Alquimia Digital

  Sample input:
RoundNdecimals ( -0,5314523 ; 4 )
RoundNdecimals ( 10,5445 ; 6)
  Sample output:
-0,5315
10,544500

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

Round any value to a specified number of decimals and add zeros to the right if necessary.
Valid for positive or negative values.

Examples:

Value | decimals | result
10,5445 | 3 | 10,545
-10,5445 | 3 | -10,545
0,5314523 | 4 | 0,5315
-0,5314523 | 4 | -0,5315
12,32 | 5 | 12,32000
10,5445 | 5 | 10,544500

(I have corrected the description and added examples to make it clearer how it works)

 

Comments

Richard DeShong   Richard DeShong, Logic Tools
Oct 16, 2025
Hi Miguel, it seems that you are truncating to 2 places, then adding zeros out to NumDecimales, but the description is not clear about that. I was thinking it was rounding to NumDecimales places. Also, why do you assign NumDecimales to another variable? It seems redundant.
 

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 21 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: