Brian Dunning's FileMaker Custom Functions

ReConvertNumber ( RC ; number ; digits )

Number conversion

  Average rating: 3.7 (47 votes) Log in to vote

Erich Schmidt   Erich Schmidt

Share on Facebook Share on Twitter

  Sample input:
ReConvertNumber(0 ; "10001011","01")

ReConvertNumber(0 ; "X000X0XX","0X")

ReConvertNumber(0 ; "1F","0123456789ABCDEF")
  Sample output:
139


139


31

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

The function reconverts a number from an arbitrary numeral system to the decimal system.
This is in a certain way the inverse function of ConvertNumber. Assumed that the function call ConvertNumber("";d;n;digits) returns an x, then gives ReConvertNumber(0;x;digits) the value d.
The parameter "digits" determines the base of the used numeral system and must contain its figures in ascending order.
The parameter "number" is the number to be converted. If "number" contains figures that are not appear within "digits", the function returns a question mark.
If digits contains less than 2 characters a conversion from binary (with figures 0 and 1) is assumed.

 

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.