Brian Dunning's FileMaker Custom Functions

ConvertNumber ( RC ; decimal ; NbrOfDigits ; digits )

number conversion

  Average rating: 4.8 (25 votes) Log in to vote

Erich Schmidt   Erich Schmidt

Share on Facebook Share on Twitter

  Sample input:
ConvertNumber( "" ; 24 ; 0; "01")
Convert Number(""; 233; 0; "0123456789ABCDEF")
ConvertNumber(""; 99; 5;"01234567")
  Sample output:
11000

E9

00143

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

The function converts a decimal number to its equivalent of any numeral system.
The parameter "digits" determines what base is used. The number of characters in "digits" is the base. The first character in "digits" represents the figure 0. The second one represents the figure 1 and so on.
If the parameter "NbrOfDigits" is set to 0, the function calculates the number of displayed digits itself. Otherwise the function value contains leading zeros or is cut off.

Set digits to "01" to convert to binary. To convert to octal system use digits "01234567". A hexadecimal conversion makes "0123456789ABCDEF" and so on.

 

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.

Under construction. Email me your wish list for improvements.