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

AddDollarFormat ( Number )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.1  (39 votes)
  Discuss this Custom Function

Jeremiah Small, Soliant Consulting
http://jsmall.us

Turn unformatted number into dollars with commas rounded to nearest penny.

Sample Input:
AddDollarFormat ( 123456789 )
Sample Output:
$ 123,456,789.00


 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:

Note: On 10/5/2006, Micah Woods modified the function to support negative numbers. Thanks Micah.

Note: A typo was fixed in this function on 9/14/2005 which caused the original version to return the wrong value for 7 and 8 figure numbers. Thanks to Angie at Biscuit Technology for reporting the problem :)

This function takes an unformatted number and formats it with dollar sign, commas, and rounds to the nearest penny. It is useful if you need to display dollar results in a concatenated text field with other text. It only will format numbers up to 999,999,999.99. Numbers larger than that will be returned without commas. Of course if you need to format 1 billion dollars and higher, you can afford to have me extend the range if you can't figure out how to do it yourself :)

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 10 comments

Um, doesn't this just mean that the student buys the paper beorfe the first draft is due? And that you've probably edited a purchased paper?You can usually purchase different levels of work, on a sliding price scale. So the student buys a B paper, takes it to you, you discuss it and edit it together, and the kid saves the money and gets an A-. Now, you can usually get around this, but you have to keep track of the student step by step from the initial planning stages all the way to the final draft. Brainstorming, freewriting, outlining, drafting, etc. You can then have them write a reflection essay on the process itself. And that's all more work than most anyone can actually keep track of, as a teacher.(Also, be aware that your students are also having their friends and family edit i.e., rewrite their work for them.)My solution at the high school level is rather simple. Our curricula specifies that we have to assign one formal take-home essay and one in-class essay test every eight weeks. So I have students write the in-class essay test first. Then they have to revise and expand it (double the size) for their take-home essay, which they submit to a plagiarism-checking website.

Andre, ev4FbdZUIu
November 27, 2015 1:14pm

much better like this:

Let ( [ S = Round ( Abs ( 123456789012.567 ) ; 2 ) ;
I = Int ( S ) ;
L = Length ( I ) ;
D = Right ( S; 2 );
Dec = If ( S <> I ; D ; "00" )
] ;

Case (S < 0 ; "-") & "$" &
Case (
L = 12 ; Left ( I ; 3 ) & "," & Middle ( I ; 4 ; 3 ) & "," & Middle ( I ; 7 ; 3 ) & "," & Right ( I ; 3 ) ;
L = 11 ; Left ( I ; 2 ) & "," & Middle ( I ; 3 ; 3 ) & "," & Middle ( I ; 6 ; 3 ) & "," & Right ( I ; 3 ) ;
L = 10 ; Left ( I ; 1 ) & "," & Middle ( I ; 2 ; 3 ) & "," & Middle ( I ; 5 ; 3 ) & "," & Right ( I ; 3 ) ;
L = 9 ; Left ( I ; 3 ) & "," & Middle ( I ; 4 ; 3 ) & "," & Right ( I ; 3 ) ;
L = 8 ; Left ( I ; 2 ) & "," & Middle ( I ; 3 ; 3 ) & "," & Right ( I ; 3 ) ;
L = 7 ; Left ( I ; 1 ) & "," & Middle ( I ; 2 ; 3 ) & "," & Right ( I ; 3 ) ;
L = 6 ; Left ( I ; 3 ) & "," & Right ( I ; 3 ) ;
L = 5 ; Left ( I ; 2 ) & "," & Right ( I ; 3 ) ;
L = 4 ; Left ( I ; 1 ) & "," & Right ( I ; 3 ) ;
I
)
& "." & Dec
)

Omelyan Burtnyk, Chicago, IL USA
June 26, 2016 9:13pm

or like this:

Let ( [
S = Round ( Abs ( 123456789012.567 ) ; 2 ) ;
I = Int ( S ) ;
L = Length ( I ) ;
D = Right ( S; 2 );
Dec = If ( S <> I ; D ; "00" )
] ;

Case (S < 0 ; "-") & "$" &
Case (
L = 12 ; Left ( I ; 3 ) & " " & Middle ( I ; 4 ; 3 ) & " " & Middle ( I ; 7 ; 3 ) & " " & Right ( I ; 3 ) ;
L = 11 ; Left ( I ; 2 ) & " " & Middle ( I ; 3 ; 3 ) & " " & Middle ( I ; 6 ; 3 ) & " " & Right ( I ; 3 ) ;
L = 10 ; Left ( I ; 1 ) & " " & Middle ( I ; 2 ; 3 ) & " " & Middle ( I ; 5 ; 3 ) & " " & Right ( I ; 3 ) ;
L = 9 ; Left ( I ; 3 ) & " " & Middle ( I ; 4 ; 3 ) & " " & Right ( I ; 3 ) ;
L = 8 ; Left ( I ; 2 ) & " " & Middle ( I ; 3 ; 3 ) & " " & Right ( I ; 3 ) ;
L = 7 ; Left ( I ; 1 ) & " " & Middle ( I ; 2 ; 3 ) & " " & Right ( I ; 3 ) ;
L = 6 ; Left ( I ; 3 ) & " " & Right ( I ; 3 ) ;
L = 5 ; Left ( I ; 2 ) & " " & Right ( I ; 3 ) ;
L = 4 ; Left ( I ; 1 ) & " " & Right ( I ; 3 ) ;
I
)
& "." & Dec
)

Omelyan Burtnyk, Chicago, IL USA
June 26, 2016 9:18pm

And are generally good in a real project, like that:

Let ( [
CU = Globals::currencySymbol;
DP = Globals::decimalPoint;
BP = Globals::brakePoint;
ND = Globals::num_of_Decimals;
S = Round ( Abs ( Table::Field ) ; ND ) ;
I = Int ( S ) ;
L = Length ( I ) ;
D = Right ( S; ND );
Dec = If ( S <> I ; D ; "00" )
] ;

Case (S < 0 ; "-") & CU &
Case (
L = 12 ; Left ( I ; 3 ) & BP & Middle ( I ; 4 ; 3 ) & BP & Middle ( I ; 7 ; 3 ) & BP & Right ( I ; 3 ) ;
L = 11 ; Left ( I ; 2 ) & BP & Middle ( I ; 3 ; 3 ) & BP & Middle ( I ; 6 ; 3 ) & BP & Right ( I ; 3 ) ;
L = 10 ; Left ( I ; 1 ) & BP & Middle ( I ; 2 ; 3 ) & BP & Middle ( I ; 5 ; 3 ) & BP & Right ( I ; 3 ) ;
L = 9 ; Left ( I ; 3 ) & BP & Middle ( I ; 4 ; 3 ) & BP & Right ( I ; 3 ) ;
L = 8 ; Left ( I ; 2 ) & BP & Middle ( I ; 3 ; 3 ) & BP & Right ( I ; 3 ) ;
L = 7 ; Left ( I ; 1 ) & BP & Middle ( I ; 2 ; 3 ) & BP & Right ( I ; 3 ) ;
L = 6 ; Left ( I ; 3 ) & BP & Right ( I ; 3 ) ;
L = 5 ; Left ( I ; 2 ) & BP & Right ( I ; 3 ) ;
L = 4 ; Left ( I ; 1 ) & BP & Right ( I ; 3 ) ;
I
)
& DP & Dec
)

Omelyan Burtnyk, Chicago, IL USA
June 26, 2016 9:40pm

I prefer something like this...
//AddDollarFormat(number_;return;separator)
//ex. AddDollarFormat(123456789;"";"") return 123,456,789

Let(
[
n=number_;
l=Length(n);
r= Right(n;3);
s= Left(n;l-3);
j=Ceiling(l/3);
return=r& separator & return

];
Case(j=1;return;AddDollarFormat(s;return;separator))
)

Rene d'Auteuil, Montreal
February 14, 2017 12:24pm

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 8 + 8 =
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. ListSort ( ValueList )
  (Mon, Aug 21, 11:04am)
2. AddSortOrder ( values ; padWidth ; delimiter ; currentValue )
  (Wed, Aug 16, 10:37am)
3. AddAddHiddenSortOrder ( values ; currentValue )
  (Wed, Aug 16, 10:31am)
4. String_to_Number_in_Scientific_Notation ( text )
  (Tue, Aug 15, 9:20am)
5. Quartic_Solver ( a, b, c , d, e, which_x )
  (Sun, Aug 13, 1:05pm)
6. SQLRefSimple ( FldRef ; Option1TO2Fld3Both )
  (Fri, Aug 11, 3:19pm)
7. BinaryStringXOR ( a ; b )
  (Mon, Aug 07, 1:46pm)
8. VarListCreatorPro ( VarType, VarName, VarValue, Mode)
  (Mon, Aug 07, 1:05pm)

RSS Feed of Custom Functions