Brian Dunning's FileMaker Custom Functions

PrevRoundNumber ( number )

Shows next lowest round number (as to determine a chart minimum)

  Average rating: 4.3 (30 votes) Log in to vote

Joe Rovang   Joe Rovang - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
PrevRoundNumber ( 42 )
  Sample output:
40

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

This function finds the next lowest "round" number, based on whatever factor of ten the original number is based. For instance, 11 becomes 10; 200 becomes 100; 0.4 becomes 0.3; and -120 becomes -200. (In this function, a "round" number is regarded as an integer multiplied by some power of ten.)

This function might be useful for determining a chart's minimum scale (as in xmCHART): for example, if the minimum data point is -428, this function returns -500 as an appropriate chart minimum. It bumps already round numbers down (200 goes to 100), on the principle that a chart's data point should never lie directly on the minimum (An exception is made for zero.)

 

Comments

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