AddDollarFormat ( Number )
Rate this function: Average rating: 3.9 (8 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:
|
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:Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:
|
Newest Custom Functions:
| 1. |
GroupRelationInfo ( FileTarget ; TableTarget ; Result ) |
| |
(Tue, Mar 16, 5:57am) |
| 2. |
GeoBox(latitude;longitude; radius) |
| |
(Mon, Mar 15, 11:04am) |
| 3. |
MonthNameList ( start; number; short ) |
| |
(Sun, Mar 14, 11:45pm) |
| 4. |
matchListAB( ListA ; ListB; match_Value; match_operator ; getN ) |
| |
(Sun, Mar 14, 10:29pm) |
| 5. |
Bin2Hex ( binary ) |
| |
(Sat, Mar 13, 10:08pm) |
| 6. |
SlideView (text) |
| |
(Sat, Mar 13, 8:40pm) |
| 7. |
HashFNV1a64 ( text ; empty ) |
| |
(Sat, Mar 13, 6:23pm) |
| 8. |
HashFNV1a32 ( text ; empty ) |
| |
(Sat, Mar 13, 5:55pm) |
 |
|
This is better than mine because it inserts commas. (I guess that depends on whether you want commas.)
Brian Dunning, Laguna Niguel, CA
January 19, 2009 3:41pm