Software Venture Consulting

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

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


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

FormatNumberAsText ( number ; currency ; separator ; decimal ; precision )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 3.8  (59 votes)
  Discuss this Custom Function

Geoffrey Gerhard, Creative Solutions Incorporated
http://www.creativesltns.com

Number to text, padded/rounded to a specified number of decimal places, user specified decimal and thousands separators, optionally displayed currency symbol

Sample Input:
FormatNumberAsText ( 12345678901234567.1234 ; "$" ; "," ; "." ; 2 )
==========
FormatNumberAsText ( 1234567.1234 ; "€" ; " " ; "," ; 2 )
Sample Output:
$12,345,678,901,234,567.12
==========
€1 234 567,12


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

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

This function formats numbers for use in text strings or calculations with a text result. It's especially useful when there are multiple numbers in a text string and at least one must be displayed in a different format than the others. It works on numbers of any length, and produces its result without recursion.

Separator and Currency parameters are optional.
Decimal parameter defaults to "." or "," (based on localization) unless rounding is <= 0, in which case it's omitted.
Precision defaults to 2 if parameter is not a digit or is unspecified.

UPDATED 11.20.2009
Added " + 0" to declaration of "n" variable to deal with cases where the number parameter is null or empty.

UPDTED 09.10.2015
Fixed a bug that resulted in malformed numbers ( like "€10..05,05" ) in some European FMP 12 (and higher) files.
Modified Decimal to use the correct integer/fraction separator [ "." or "," ] for the file's region when the decimal parameter is null.

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

This is my Custom Function and I want to edit it

Discuss:

5 most recent comments | Show all 22 comments

Thank you so much! This is a great and necessary function. Any idea why FileMaker hasn't provided this as a standard feature?

Joe, Newport Beach, CA
April 22, 2016 1:53pm

Much appreciated. Just what I needed to correctly format currency amount totals within a text calculation field.

Ian, Melbourne Australia
April 27, 2016 11:35pm

This function saved the day!!! Shame on filemaker for not including it.

John, Portland, Oregon
June 30, 2016 9:49am

Thanks so much for this function—works!

Seamus Berkeley, Taos
October 17, 2016 9:31pm

Very nice custom function. Very useful. Works like a charm.
Cheers!

Luis Sardinha, Gloucester, UK
July 14, 2017 3:11am

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

Your Name:
City/Location:
Comment:
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 7 + 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. ProperAllWords ( text )
  (Thu, Dec 14, 5:19pm)
2. MatchExist ( SourceTable.Field ; DestTable.Field ; ReturnField )
  (Thu, Dec 14, 1:07pm)
3. BVR_Format ( bvr )
  (Wed, Dec 13, 5:32pm)
4. NumberToHexadecimal(NumberValue)
  (Fri, Dec 08, 8:54am)
5. Get_BaseTable
  (Thu, Dec 07, 4:27pm)
6. JSONCreateVarsFromKeys ( json ; namespace )
  (Wed, Dec 06, 8:21pm)
7. GetTableNzme ( field )
  (Tue, Dec 05, 9:16pm)
8. TimeFormatAsText ( theTime )
  (Mon, Nov 13, 1:59pm)

RSS Feed of Custom Functions