Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


Privacy Policy

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.


 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

NumToDuoTrigesimal ( number )

Rate this function:  

  Average rating: 4.7  (32 votes)
  Discuss this Custom Function

Tim Griffith, None

Converts a number into a duotrigesimal (base32) string

Sample Input:
NumToDuoTrigesimal ( 123456789 )
Sample Output:

 Then copy & paste into FileMaker Advanced's Edit Custom Function window.


NumToDuoTrigesimal ( number )

No dependencies

( to convert Duotrigesimal strings back to numbers use custom function DuoTrigesimalToNum ( DTGString ) )

Created: December 26, 2010 St. Louis, MO USA

Tim Griffith Sr.

Duotrigesimal, or base 32 numbers are like Hexadecimal numbers in that after 9, numbers are represented by letters. We know we can't use all the letters of the alphabet because the index of numbers would go beyond 31 up to 35. As best I have discovered the letters 'I' 'L' and 'O' are not used because in various forms they can be mistaken for other characters. My research has also shown that the letter 'U' has been omited because of 'accidental obscenities'.
Throughout books and the internet there are numerous algorithms showing how to convert numbers to hex and hex to numbers. I am not a genius, but rather a bit clever enough to augment those formulas to add the additional letters beyong hex F, and substitute dividing or multplying 16 into 32. All in all it was quite simple.
If credit is due- then it is due to those many people who have provided hex to num formulas. Thank you all- you know who you are!

Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it


You could make it more portable (easy to change the allowed character set and quantity) by not hard-coding the number of characters in your base. Just do the following:

Let ( [
_BASE = Mod ( number ; Length( _ALPH ) ) ;
_CHAR = Middle ( _ALPH ; _BASE + 1 ; 1 ) ;
_NEXT = Div ( number ; Length( _ALPH ) )
] ;

Case (
NumToDuoTrigesimal ( _NEXT )
)//end Case
)//end Let

Or to make it incredibly portable, make the "base string" (your _ALPH variable) be a parameter, and name the function BaseConvert( baseString, decimalNumber ).

Daniel A. Shockley, New York, NY
January 13, 2011 11:25am

Where baseString is used instead of _ALPH in the custom function, and decimalNumber is used instead of number to make it clear that the number must be in decimal, not some other custom base).

Daniel A. Shockley, New York, NY
January 13, 2011 11:27am

Thanks Daniel, very inspired thinking on your part- I should have seen this- but I was so connected to the idea of of a cf for for base 32 that I missed the logic of the simpler solution. I am going to work this and post it.

Tim Griffith, St. Louis, MO USA
January 13, 2011 1:34pm

Daniel, OK, the conversion you noted from number to BASEx was very easy indeed- just as you stated. However, converting back from a BASEx presents lots of extra programmed reasoning- in that, allowing the user to create any BASE system, you will end up with letters in positions that will have to be calculated, ie. A will not always be the 10th character etc. Plus, a user BASE might also allow juxtaposing alpha and numeric, such as character set = 01BFT74K983D5. Sure this can be worked out, but not as elegantly as just dealing with an accepted standard base system.
So, to create a custom BASEx conversion-- follow Daniels inspired observations. I tried it, it worked well. As far as a reverse conversion- I'll let another wise person out there figure it out. I think there is already an 'any base' cf on the list, so there might also be the reverse conversion there also. I am currently very busy with an HL7 parser.

Tim Griffith, St. Louis
January 13, 2011 5:17pm

Tim, we ended up adapting your original function to allow for any base conversion ( BaseX_FromDecimal: ). I also created a function to allow for conversion back to decimal, provided the same baseString is used ( BaseX_ToDecimal: ).

Erik Shagdar, New York, NY
June 20, 2017 9:38am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 2 + 9 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. SortList ( theList )
  (Sat, Jun 23, 8:45am)
2. HexUUIDToNum_cf (_uuid)
  (Sat, Jun 16, 1:55pm)
3. httpResponseCode ( responseHeaders )
  (Tue, Jun 12, 10:40pm)
4. FindDuplicateCharacters ( string )
  (Fri, Jun 08, 5:01pm)
5. FieldRepetitionLast ( field ; maxRepetition )
  (Wed, Jun 06, 6:05pm)
6. CountModifiedRecords ( NameTimestampField ; StartTimestamp ; EndTimestamp )
  (Mon, May 28, 8:23am)
7. JSONArrayLength ( JSONArrayStr )
  (Fri, May 25, 7:46am)
8. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)

RSS Feed of Custom Functions