Brian Dunning's FileMaker Custom Functions

NumText ( theNumber ; CurrSymbol ; Separator ; Decimal )

Converts number to formatted text equivalent

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

Matt Wills   Matt Wills
Virtual Vermont
http://www.virtualvermont.com/FMP/

Share on Facebook Share on Twitter

  Sample input:
NumText (123456.78 ; "$" "," ; ".")

Numtext (123456789 ; "" ; "," ; "")
  Sample output:
$123,456.78

123,456,789

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

Converts a number to its formatted text equivalent.

Expands on Jeremiah Small's AddDollarFormat cf, with these differences:

-Accommodates up to Billions;
-Retains the decimal portion of the original number;
-Allows user to decide whether to include currency notation.

CurrSymbol: the desired currency symbol.

Separator: the desired thousands separator. Defaults to comma if left blank.

Decimal: the desired symbol for decimal separator. Decimal portion of number is DROPPED if left blank.

 

Comments

Ken Barker   Ken Barker, Wexford/Ireland
Feb 19, 2013
I had to modify this as I required to always have 2 places of decimals.

See below

R =
Substitute ( If ( not IsEmpty ( Decimal ) ;
Case (
theNumber - Int ( theNumber ) > 0 and Length ( theNumber - Int ( theNumber ) ) ≥ 3; theNumber - Int ( theNumber );
theNumber - Int ( theNumber ) > 0 and Length ( theNumber - Int ( theNumber ) ) = 2; theNumber - Int ( theNumber ) & "0";

".00");


""); "."; Decimal )

It still saved me some time so thanks a lot...
 

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.