Brian Dunning's FileMaker Custom Functions

DecToAnyBase ( decimal ; base )

Returns the representation of a decimal (base-10) number in the alphabet of the specified base.

  Average rating: 4.1 (46 votes) Log in to vote

Michael Horak   Michael Horak - Show more from this author
*COMMENT Visual Realisation

Share on Facebook Share on Twitter

  Sample input:
DecToAnyBase ( 256 ; 8 )
  Sample output:
400

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

DecToAnyBase function

Author
*COMMENT Visual Realisation

Format
DecToAnyBase ( decimal ; base )

Parameters
decimal - any numeric expression or field containing a non-negative numeric expression. Only the integer part of decimal will be considered.

base - any numeric expression or field containing a non-negative numeric expression.

Data type returned
text

Description
Returns the representation of a decimal (base-10) number in the alphabet of the specified base.

Note:
As provided, DecToAnyBase() will convert a decimal number to any base between 2 and 16, using standard symbols.

The function can be easily modified to accomodate bases greater than 16 and/or other symbols, incl. compound (more than one character per symbol) symbols.

 

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: