{"id":165,"date":"2011-12-02T20:08:21","date_gmt":"2011-12-02T20:08:21","guid":{"rendered":"http:\/\/www.lorenzcom.com\/?p=165"},"modified":"2020-12-03T07:30:11","modified_gmt":"2020-12-03T13:30:11","slug":"formatnumber-number-format","status":"publish","type":"post","link":"https:\/\/lorenzcom.com\/?p=165","title":{"rendered":"FormatNumber"},"content":{"rendered":"<h3>FormatNumber ( number , format )<\/h3>\n<p>FormatNumber is a one-pass FileMaker Pro custom function that formats a number using intuitive, free-form format options that completely mimic FileMaker Pro&#8217;s number data type formatting. Formatting options can also be specified via escaped options. Returns text string of number in the requested format.<\/p>\n<h4>Parameters<\/h4>\n<ul>\n<li>number = The number to be formatted.<\/li>\n<li>format = Text string specifying the returned format of the number.<\/li>\n<\/ul>\n<h4>Examples<\/h4>\n<ul>\n<li>FormatNumber ( 14725.3675, &#8220;$,.2 US&#8221; ) = $14,725.37 US<\/li>\n<li>FormatNumber ( -14725.3675, &#8220;$(,.2) US\\r0\\&#8221; ) = $(14,725.36) US [rounding off]<\/li>\n<li>FormatNumber ( -14725.3675, &#8220;#,.\\c255\\&#8221; ) = <span style=\"color: #ff0000;\">#-14,725.3675<\/span> [text color is red]<\/li>\n<li>FormatNumber ( 1, &#8220;Yes||No&#8221; ) = Yes<\/li>\n<li>FormatNumber ( 5973600, &#8220;^&#8221; ) = 5.9736e6<\/li>\n<li>FormatNumber ( 59703600, &#8220;~0 kg&#8221; ) = 59.7036e6 kg [engineering notation]<\/li>\n<\/ul>\n<h4>HELP<\/h4>\n<p>Passing &#8216;?&#8217; as the only content of &#8216;format&#8217; returns a shortened version of this text.<\/p>\n<h4>Number Formatting:<\/h4>\n<ul>\n<li>, &#8211; (thousands separator) integer portion of the number is &#8220;thousands separated&#8221;.<\/li>\n<li>. &#8211; (decimal separator) displays of the decimal portion of the number.<\/li>\n<li># &#8211; (number) specifies the rounding precision (controls the count of decimal number digits to display):\n<ul>\n<li>0 &#8211; number decimal and decimal separator is not displayed. Enables positioning of negative signs and notations.<\/li>\n<li>1&#8230;n &#8211; Truncation and rounding precision of the number decimal.<\/li>\n<li>. &#8211; decimal separator only, with no number, displays the unaltered number decimal.<\/li>\n<\/ul>\n<\/li>\n<li>^ &#8211; (caret) formats number in scientific E notation.<\/li>\n<li>~ &#8211; (tilde) formats number in engineering E notation.<\/li>\n<\/ul>\n<h4>Negative Sign Formatting:<\/h4>\n<ul>\n<li>&#8211; &#8211; minus sign (default) (default: left).<\/li>\n<li>&lt;&gt; &#8211; angle brackets (default: left and rigth).<\/li>\n<li>() &#8211; parentheses (default: left and right).<\/li>\n<li>CR &#8211; credit symbol (default: right).<\/li>\n<li>\u2206 &#8211; delta symbol (default: left). (Black delta is output.)<\/li>\n<\/ul>\n<p>Minus sign, credit and delta symbols can be displayed on the left or right of the formatted number by placing them to the left or right of an included decimal separator, or zero, in &#8216;format&#8217;. Negative signs are placed at their default location when no decimal separator is included.<\/p>\n<h4>Boolean Formatting:<\/h4>\n<ul>\n<li>|| &#8211; two pipe characters divide boolean results. True number returns left side. False number returns right side.<\/li>\n<\/ul>\n<h4>Notation Formatting:<\/h4>\n<ul>\n<li>% &#8211; percent sign. Inclusion in &#8216;format&#8217; forces multiplication of the number by 100 (default: right).<\/li>\n<li>$, \u00a3, #, etc. &#8211; dollar, pound, hash, and any other characters, can be included in the formatted number (default: left).<\/li>\n<\/ul>\n<p>Percent, currency and other notations can be placed on either side of the formatted number depending on whether you place them at the left or right of an included decimal separator, or zero, in &#8216;format&#8217;. Notations are placed at their default position when no decimal separator is included. The user must insure that the notations in &#8216;format&#8217; produces the desired formatted result.<\/p>\n<h4>Escaped Options Formatting:<\/h4>\n<ul>\n<li>\\T &#8211; (text) thousands separator (default: system).<\/li>\n<li>\\D &#8211; (text) decimal separator (default: system).<\/li>\n<li>\\R &#8211; (boolean) round number to passed precision (default: true).<\/li>\n<li>\\Z &#8211; (boolean) show number if zero (default: true).<\/li>\n<li>\\F &#8211; (boolean) fill (pad) decimal with zeros to length of passed precision (default: true).<\/li>\n<li>\\SL &#8211; (text) negative sign (-, &lt;&gt;, (), CR, \u2206) appearing on left side of number (default: minus sign).<\/li>\n<li>\\SR &#8211; (text) negative sign (-, &lt;&gt;, (), CR, \u2206) appearing on right side of number (default: empty).<\/li>\n<li>\\PL &#8211; (boolean) proximity of negative sign on left side is next to number (default: true).<\/li>\n<li>\\PR &#8211; (boolean) proximity of negative sign on right side is next to number (default: true).<\/li>\n<li>\\NL &#8211; (text) notation sign ($, %, #, etc.) to appear on left side of number (default: empty).<\/li>\n<li>\\NR &#8211; (text) notation sign ($, %, #, etc.) to appear on right side of number (default: empty).<\/li>\n<li>\\C &#8211; (integers) comma-separated RGB number text (#,#,#) to color negative number (default: black).<\/li>\n<li>\\X &#8211; (integer) exponentiation formatting: 0 = none, 1 = scientific, 2 = engineering (default: 0).<\/li>\n<li>\\BP &#8211; (text) positive response to boolean formatting.<\/li>\n<li>\\BN &#8211; (text) negative response to boolean formatting.<\/li>\n<\/ul>\n<p>Escaped options override free-form format, defaults and add formatting. Enclose each option with escape (backslash) characters \\\\\\\\.<\/p>\n<hr \/>\n<h4>REVISION NOTES:<\/h4>\n<p>Revised February 11, 2014. Added code to process numbers input in scientific notation format and to return numbers in scientific and engineering notation format. Reformatted the boolean separator to be two pipe characters and added escape options to allow setting Boolean positive and negative values. Optimized the code to remove redundancies, decrease the overall size, and speed up processing. Restructured the help text to make it more concise so that it can be used easier in tool tip popups. Also, added code to determine system decimal and thousands separators.<\/p>\n<p><strong>FormatNumber code:<\/strong> Copy the selected code (click on Select All to highlight all the code) to the clipboard and paste it into a newly created Custom Function. <a href=\"\/docs\/FileMaker\/FormatNumber.zip\">Download code as a text file from here.<\/a><\/p>\n<form><textarea id=\"te_165\" style=\"width: 100%; height: 180px; font-family: Arial,Helvetica; font-size: .90em; line-height: normal;\">&lt;!&#8211;raw&#8211;&gt;Let ( [ nbr = SetPrecision ( GetAsNumber ( number ); 400 ); fmt = Substitute ( GetAsText ( format ); [ &#8220;\u00b6&#8221;; &#8220;&#8221; ]; [ Char (10); &#8220;&#8221; ]; [ Char (13); &#8220;&#8221; ] );&lt;br \/&gt;<br \/>\nsts = Middle ( NumToJText ( 1000; 1; 0 ); 2; 1 ); sds = Middle ( 3\/2; 2; 1 );&lt;br \/&gt;<br \/>\nneg = nbr &lt; 0;<br \/>\nsgn = &#8220;-\u00b6-\u00b6&lt;\u00b6&gt;\u00b6(\u00b6)\u00b6\u2206\u00b6\u2206\u00b6CR\u00b6CR&#8221;;&lt;br \/&gt;<br \/>\n\/* OPTIONS Thousands, Decimal, Rounding, Zero, Fill, Sign Left, Sign Right, Proximity Left, Proximity Right, Notation Left, Notation Right, Color, Exponentiation (0=None, 1=Sci, 2=Eng), Boolean Positive, Boolean Negative. *\/&lt;br \/&gt;<br \/>\nopt = List ( &#8220;\u00b6&#8221;; True; True; True; &#8220;\u00b6\u00b6\u00b6\u00b6\u00b6&#8221;; &#8220;0,0,0&#8221;; &#8220;\u00b6\u00b6&#8221; );&lt;br \/&gt;<br \/>\n\/* ESCAPED OPTIONS. Escaped format options override dissimilar defaults&#8230; *\/&lt;br \/&gt;<br \/>\nopt =&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\T&#8221;; 1; 1); If ( p; Middle ( fmt; p + 2; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 2 ) ); GetValue ( opt; 1 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\D&#8221;; 1; 1); If ( p; Middle ( fmt; p + 2; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 2 ) ); GetValue ( opt; 2 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\R&#8221;; 1; 1); If ( p; Middle ( fmt; p + 2; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 2 ) ); GetValue ( opt; 3 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\Z&#8221;; 1; 1); If ( p; Middle ( fmt; p + 2; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 2 ) ); GetValue ( opt; 4 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\F&#8221;; 1; 1); If ( p; Middle ( fmt; p + 2; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 2 ) ); GetValue ( opt; 5 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\SL&#8221;; 1; 1); If ( p; Middle ( fmt; p + 3; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 3 ) ); GetValue ( opt; 6 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\SR&#8221;; 1; 1); If ( p; Middle ( fmt; p + 3; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 3 ) ); GetValue ( opt; 7 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\PL&#8221;; 1; 1); If ( p; Middle ( fmt; p + 3; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 3 ) ); GetValue ( opt; 8 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\PR&#8221;; 1; 1); If ( p; Middle ( fmt; p + 3; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 3 ) ); GetValue ( opt; 9 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\NL&#8221;; 1; 1); If ( p; Middle ( fmt; p + 3; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 3 ) ); GetValue ( opt; 10 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\NR&#8221;; 1; 1); If ( p; Middle ( fmt; p + 3; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 3 ) ); GetValue ( opt; 11 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\C&#8221;; 1; 1); If ( p; Middle ( fmt; p + 2; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 2 ) ); GetValue ( opt; 12 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\E&#8221;; 1; 1); If ( p; Middle ( fmt; p + 2; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 2 ) ); GetValue ( opt; 13 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\BP&#8221;; 1; 1); If ( p; Middle ( fmt; p + 3; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 3 ) ); GetValue ( opt; 14 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nLet ( p = Position ( fmt; &#8220;\\BN&#8221;; 1; 1); If ( p; Middle ( fmt; p + 3; Position ( fmt; &#8220;\\\\&#8221;; p; 2 ) &#8211; ( p + 3 ) ); GetValue ( opt; 15 ) ) );&lt;br \/&gt;<br \/>\n\/* &#8230; clear escaped options. *\/&lt;br \/&gt;<br \/>\nfmt = If ( PatternCount ( fmt; &#8220;\\\\&#8221; );&lt;br \/&gt;<br \/>\nSubstitute ( fmt ; [&#8220;\\t&#8221;; &#8220;\\T&#8221; ]; [&#8220;\\d&#8221;; &#8220;\\D&#8221; ]; [&#8220;\\r&#8221;; &#8220;\\R&#8221; ]; [&#8220;\\z&#8221;; &#8220;\\Z&#8221; ]; [&#8220;\\f&#8221;; &#8220;\\F&#8221; ]; [&#8220;\\s&#8221;; &#8220;\\S&#8221; ]; [&#8220;\\n&#8221;; &#8220;\\N&#8221; ]; [&#8220;\\p&#8221;; &#8220;\\P&#8221; ]; [&#8220;\\c&#8221;; &#8220;\\C&#8221; ]; [&#8220;\\e&#8221;; &#8220;\\E&#8221; ]; [&#8220;\\b&#8221;; &#8220;\\B&#8221; ]; [&#8220;\\Sl&#8221;; &#8220;\\SL&#8221; ]; [&#8220;\\Sr&#8221;; &#8220;\\SR&#8221; ]; [&#8220;\\Nl&#8221;; &#8220;\\NL&#8221; ]; [&#8220;\\Nr&#8221;; &#8220;\\NR&#8221; ]; [&#8220;\\Pl&#8221;; &#8220;\\PL&#8221; ]; [&#8220;\\Pr&#8221;; &#8220;\\PR&#8221; ]; [&#8220;\\Bp&#8221;; &#8220;\\BP&#8221; ]; [&#8220;\\Bn&#8221;; &#8220;\\BN&#8221; ]; [&#8220;\\T&#8221; &amp; GetValue ( opt; 1 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\D&#8221; &amp; GetValue ( opt; 2 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\R&#8221; &amp; GetValue ( opt; 3 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\Z&#8221; &amp; GetValue ( opt; 4 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\F&#8221; &amp; GetValue ( opt; 5 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\SL&#8221; &amp; GetValue ( opt; 6 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\SR&#8221; &amp; GetValue ( opt; 7 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\NL&#8221; &amp; GetValue ( opt; 10 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\NR&#8221; &amp; GetValue ( opt; 11 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\PL&#8221; &amp; GetValue ( opt; 8 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\PR&#8221; &amp; GetValue ( opt; 9 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\C&#8221; &amp; GetValue ( opt; 12 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\E&#8221; &amp; GetValue ( opt; 13 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\BP&#8221; &amp; GetValue ( opt; 14 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]; [&#8220;\\BN&#8221; &amp; GetValue ( opt; 15 ) &amp; &#8220;\\\\&#8221;; &#8220;&#8221;]  );&lt;br \/&gt;<br \/>\nfmt );&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* BOOLEAN.  Set opt(14) and opt(15) from fmt. *\/&lt;br \/&gt;<br \/>\nopt = If ( PatternCount ( fmt; &#8220;||&#8221; ) and IsEmpty ( GetValue ( opt; 14 ) ) and IsEmpty ( GetValue ( opt; 15 ) );&lt;br \/&gt;<br \/>\nMiddleValues ( opt; 1; 13 ) &amp; LeftValues ( Substitute ( fmt; [&#8220;||&#8221;;&#8221;\u00b6&#8221;] ); 2 );&lt;br \/&gt;<br \/>\nopt );&lt;br \/&gt;<br \/>\nboo = not IsEmpty ( GetValue ( opt; 14 ) ) or not IsEmpty ( GetValue ( opt; 15 ) );&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* EXPONENTIATION. Set opt(13) from fmt: 0 = none, 1 = Scientific., 2 = Engineeering. *\/&lt;br \/&gt;<br \/>\nopt = If ( IsEmpty ( GetValue ( opt; 13 ) ); Let ( e = Filter ( fmt; &#8220;^~&#8221; );&lt;br \/&gt;<br \/>\nMiddleValues ( opt; 1; 12 ) &amp; GetAsText ( Position ( &#8220;^~&#8221;; Left ( e; 1 ); 1; 1 ) ) &amp; &#8220;\u00b6&#8221; &amp; MiddleValues ( opt; 14; 2 ) );&lt;br \/&gt;<br \/>\nopt );&lt;br \/&gt;<br \/>\n\/* &#8230; clear exponentiation codes from fmt. *\/&lt;br \/&gt;<br \/>\nfmt = Substitute ( fmt; [ &#8220;^&#8221;; &#8220;&#8221; ]; [ &#8220;~&#8221;; &#8220;&#8221; ] );&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* PRECISION. Digits in fmt used for precision and rounding (n) or positioning (0). *\/&lt;br \/&gt;<br \/>\ndgt = Let ( n = GetAsNumber ( Filter ( fmt; &#8220;0123456789&#8221; ) ); If ( n &gt; 400; 400; n ) );&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* NEGATIVE SIGN INDEX. Get index to 1st instance of neg sign pair in sgn. *\/&lt;br \/&gt;<br \/>\nndx = Let ( n = Position ( &#8220;&#8211;&lt;&gt;()\u2206&#8221;; Left ( Filter ( fmt; &#8220;-&lt;&gt;()\u2206&#8221; ); 1 ); 1; 1 ); Case ( n = 0 and PatternCount ( fmt; &#8220;cr&#8221; ); 9; n = 0 ; 1; not Mod ( n; 2 ); n &#8211; 1; n ) );&lt;br \/&gt;<br \/>\n\/* &#8230; clear non-ndx signs from fmt. *\/&lt;br \/&gt;<br \/>\nfmt = Substitute ( fmt; [ If ( ndx \u2260 1; GetValue ( sgn; 1 ); &#8220;&#8221; ); &#8220;&#8221; ]; [ If ( ndx \u2260 1; GetValue ( sgn; 2 ); &#8220;&#8221; ); &#8220;&#8221; ]; [ If ( ndx \u2260 3; GetValue ( sgn; 3 ); &#8220;&#8221; ); &#8220;&#8221; ]; [ If ( ndx \u2260 3; GetValue ( sgn; 4 ); &#8220;&#8221; ); &#8220;&#8221; ]; [ If ( ndx \u2260  5; GetValue ( sgn; 5 ); &#8220;&#8221; ); &#8220;&#8221; ]; [ If ( ndx \u2260 5; GetValue ( sgn; 6 ); &#8220;&#8221; ); &#8220;&#8221; ]; [ If ( ndx \u2260 7; GetValue ( sgn; 7 ); &#8220;&#8221; ); &#8220;&#8221; ]; [ If ( ndx \u2260 7; GetValue ( sgn; 8 ); &#8220;&#8221; ); &#8220;&#8221; ]; [ If ( ndx \u2260 9; GetValue ( sgn; 9 ); &#8220;&#8221; ); &#8220;&#8221; ]; [ If ( ndx \u2260 9; GetValue ( sgn; 10 ); &#8220;&#8221; ); &#8220;&#8221; ] ); &lt;\/p&gt;<br \/>\n&lt;p&gt;\/* SEPARATORS.  Set opt(1) and (2) from fmt. Use system defaults, if empty. *\/&lt;br \/&gt;<br \/>\nopt = If ( IsEmpty ( GetValue ( opt; 1 ) ) and PatternCount ( fmt; sts ); sts; GetValue ( opt; 1 ) ) &amp; &#8220;\u00b6&#8221; &amp; \/\/ Thousands.&lt;br \/&gt;<br \/>\nIf ( IsEmpty ( GetValue ( opt; 2 ) ) and PatternCount ( fmt; sds ); sds; GetValue ( opt; 2 ) ) &amp; &#8220;\u00b6&#8221; &amp; \/\/ Decimal.&lt;br \/&gt;<br \/>\nMiddleValues ( opt; 3; 13 );&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* FORMAT LIST. Divide fmt on decimal or zero for SIGNS, PROXIMITY and NOTATIONS. If no decimal value 1 is fmt. *\/&lt;br \/&gt;<br \/>\nfml = Let ( [ d = GetValue ( opt; 2 ); s = Case ( not IsEmpty ( d ); d; dgt = 0; &#8220;0&#8221;; &#8220;&#8221; ); n = If ( IsEmpty ( s ); 0; Position ( fmt; s; 1; 1 ) ) ]; If ( GetAsBoolean ( n ); Left ( fmt; n &#8211; 1 ) &amp; &#8220;\u00b6&#8221; &amp; Right ( fmt; Length ( fmt ) &#8211; n ); fmt ) );&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* SIGNS.  Set opt(6) and opt(7) from fmt. *\/&lt;br \/&gt;<br \/>\nopt = If ( neg and IsEmpty ( GetValue ( opt; 6 ) ) and IsEmpty ( GetValue ( opt; 7 ) );&lt;br \/&gt;<br \/>\nMiddleValues ( opt; 1; 5 ) &amp;&lt;br \/&gt;<br \/>\nLet ( [ bls = not IsEmpty ( Filter ( Upper ( GetValue ( fml; 1 ) ); MiddleValues ( sgn; ndx; 2 ) ) ); brs = not IsEmpty ( Filter ( Upper ( GetValue ( fml; 2 ) ); MiddleValues ( sgn; ndx; 2 ) ) ); bds = &#8220;\u25b2&#8221;; sl = If ( ndx = 7; bds; GetValue ( sgn; ndx ) ); sr = If ( ndx = 7; bds; GetValue ( sgn; ndx + 1 ) ) ];&lt;br \/&gt;<br \/>\nIf ( ( ndx = 1 and ( bls or not brs ) ) or ( ndx = 3 or ndx = 5 or ( ndx = 7 and bls ) ) or ( ndx = 9 and ( bls and not IsEmpty ( GetValue ( opt; 2 ) ) ) ); sl; &#8220;&#8221; ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nIf ( ( ndx = 3 or ndx = 5 or ( ( ndx = 1 or ndx = 7 ) and brs ) ) or ( ndx = 9 and ( brs or IsEmpty ( GetValue ( opt; 2 ) ) ) ); sr; &#8220;&#8221; )&lt;br \/&gt;<br \/>\n) &amp; &#8220;\u00b6&#8221; &amp; \/\/ End Let.&lt;br \/&gt;<br \/>\nMiddleValues ( opt; 8; 8 );&lt;br \/&gt;<br \/>\nopt ); \/\/ Unaltered.&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* PROXIMITY. Set opt(8) and (9) from fmt. Controls proximity of neg sign to number and on which side it is displayed. True means next to the number inside the notation, false means outside of the notation. Determined by checking whether the sgn (ndx) is far right of the left side of fmt or 1st character on the right side of fmt. *\/&lt;br \/&gt;<br \/>\nopt = If ( neg and IsEmpty ( GetValue ( opt; 8 ) ) and IsEmpty ( GetValue ( opt; 9 ) );&lt;br \/&gt;<br \/>\nMiddleValues ( opt; 1; 7 ) &amp;&lt;br \/&gt;<br \/>\nIf ( ndx = 1 and not PatternCount ( fml; GetValue ( sgn; ndx ) );&lt;br \/&gt;<br \/>\n&#8220;1\u00b61&#8221;; \/\/ Default inside.&lt;br \/&gt;<br \/>\nGetAsText ( Position ( GetValue ( fml; 1 ); GetValue ( sgn; ndx ); 1; 1 ) = (Length ( GetValue ( fml; 1 ) ) + 1 ) &#8211; Length ( GetValue ( sgn; ndx ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nIf ( ValueCount ( fml ) = 1; &#8220;0&#8221;; GetAsText ( Position ( GetValue ( fml; 2 ); GetValue ( sgn; ndx + 1 ); 1; 1 ) = 1 ) ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nMiddleValues ( opt; 10; 6 );&lt;br \/&gt;<br \/>\nopt ); \/\/ Unaltered.&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* REMOVE SIGNS. The used sign, whatever it is, is removed. Only the notations remain to be stored.*\/&lt;br \/&gt;<br \/>\nfml = Substitute ( fml; [&#8220;&lt;&#8220;; &#8220;&#8221;]; [&#8220;&gt;&#8221;; &#8220;&#8221;]; [&#8220;(&#8220;; &#8220;&#8221;]; [&#8220;)&#8221;; &#8220;&#8221;]; [&#8220;cr&#8221;; &#8220;&#8221;]; [&#8220;Cr&#8221;; &#8220;&#8221;]; [&#8220;cR&#8221;; &#8220;&#8221;]; [&#8220;CR&#8221;; &#8220;&#8221;]; [&#8220;\u2206&#8221;; &#8220;&#8221;]; [&#8220;-&#8220;; &#8220;&#8221;] );&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* NOTATION ($, %, #, etc.). Set opt(10) and opt(11) from fml. Stores notation for left and right side of number.&lt;br \/&gt;<br \/>\nOpt(10) is set to fmt left of the separator if present (including %), else it is set to fmt without % (default is all but % is displayed on the left &#8211; in opt(10)).&lt;br \/&gt;<br \/>\nOpt(11) is set to fmt right of separator if present, else it is set to % if in fmt or blank if not (default is % is displayed on right &#8211; in opt(11)). *\/&lt;br \/&gt;<br \/>\nopt = If ( IsEmpty ( GetValue ( opt; 10 ) ) and IsEmpty ( GetValue ( opt; 11 ) );&lt;br \/&gt;<br \/>\nMiddleValues ( opt ; 1 ; 9 ) &amp;&lt;br \/&gt;<br \/>\nSubstitute ( If ( ValueCount ( fml ) = 2; GetValue ( fml; 1 ); Substitute ( GetValue ( fml; 1 ); [ &#8220;%&#8221;; &#8220;&#8221; ] ) ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nIf ( ValueCount ( fml ) = 2; GetValue ( fml; 2 );  If ( PatternCount ( GetValue ( fml; 2 ); &#8220;%&#8221;); &#8220;%&#8221;; &#8220;&#8221; ) ); [ GetValue ( opt; 1 ); &#8220;&#8221; ]; [ GetAsText ( dgt ); &#8220;&#8221; ] ) &amp; &#8220;\u00b6&#8221; &amp;&lt;br \/&gt;<br \/>\nMiddleValues ( opt ; 12 ; 4 );&lt;br \/&gt;<br \/>\nopt ); \/\/ Unaltered.&lt;\/p&gt;<br \/>\n&lt;p&gt;\/\/ NUMBER PROCESSING.&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* PERCENTAGE. Multiply nbr by 100 if % is passed in fmt. Allow setting % notation via escaped option opt(8) and (9) without forcing multiplication. *\/&lt;br \/&gt;<br \/>\nnbr = If ( boo; nbr; If ( PatternCount ( fml; &#8220;%&#8221; ); Abs ( nbr ) * 100; Abs ( nbr ) ) );&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* ROUNDING\/PRECISION. If digit &gt; 0, round and\/or truncate nbr to that precision. *\/&lt;br \/&gt;<br \/>\nnbr = Case ( boo; nbr; GetAsBoolean ( GetValue ( opt; 3 ) ) and dgt &gt; 0;  Round ( nbr ; dgt ); dgt &gt; 0;  Truncate ( nbr ; dgt ); nbr );&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* NUMBERS LIST. Split number into integer w\/ or w\/o &#8220;,&#8221; and decimal without &#8220;.&#8221;. *\/&lt;br \/&gt;<br \/>\neno = Position ( nbr; &#8220;e&#8221;; 1; 1 ); \/\/ Check to convert passed scientific E notation.&lt;br \/&gt;<br \/>\nnbs = If ( eno; Let ( [ e = GetAsNumber ( Right ( nbr; Length ( nbr ) &#8211; eno ) ); z = Substitute ( 10 ^ Abs ( e ) &#8211; 1; &#8220;9&#8221;; &#8220;0&#8221; ); n = Filter ( GetAsNumber ( sds &amp; Left ( nbr; eno &#8211; 1 ) ); &#8220;1234567890&#8221; ) ];&lt;br \/&gt;<br \/>\nIf ( e &gt; 0; Left ( n &amp; z; e + 1 ) &amp;  &#8220;\u00b6&#8221; &amp; Middle ( n; e + 2; Length ( n ) ); &#8220;0\u00b6&#8221; &amp; Left ( z; Abs ( e ) &#8211; 1 ) &amp; n )&lt;br \/&gt;<br \/>\n); \/\/&#8230;else (not eno ).&lt;br \/&gt;<br \/>\nIf ( IsEmpty ( GetValue ( opt; 1 ) ) or GetAsBoolean ( GetValue ( opt; 13 ) ); GetAsText ( Int ( nbr ) ); Substitute ( NumToJText ( Int ( nbr ); 1; 0 ); [ sts; GetValue ( opt; 1 ) ] ) ) &amp; &#8220;\u00b6&#8221; &amp; Let ( [ d = nbr &amp; sds; p = Position ( d;  sds; 1; 1 ) ]; Filter ( Right ( d; Length ( d ) &#8211; p ); &#8220;1234567890&#8221; ) )&lt;br \/&gt;<br \/>\n);&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* NUMBER FORMAT. nbs is a 2 item list: integer and decimal. *\/&lt;br \/&gt;<br \/>\nres = Let ( [ t = GetAsNumber ( GetValue ( opt; 13 ) ); iv = GetValue ( nbs; 1 ); i = GetAsNumber ( iv ); dv = GetValue ( nbs; 2 ); d = GetAsNumber ( dv ) ];&lt;br \/&gt;<br \/>\nCase (&lt;br \/&gt;<br \/>\n\/\/****** Boolean.&lt;br \/&gt;<br \/>\nboo; If ( GetAsBoolean ( nbr ); GetValue ( opt; 14 ); GetValue ( opt; 15 ) );&lt;br \/&gt;<br \/>\n\/\/****** Zero.&lt;br \/&gt;<br \/>\nnot i and not d; If ( not GetAsBoolean ( GetValue ( opt; 4 ) ); &#8220;&#8221;; &#8220;0&#8221; );&lt;br \/&gt;<br \/>\n\/\/****** Exponential (1 = scientific, 2 = engineering).&lt;br \/&gt;<br \/>\nt; Let ( [ e = If ( i &gt; 0; Int ( Log ( i ) ); Int ( Log ( GetAsNumber ( sds &amp; dv ) ) ) &#8211; 1 ); n = Case ( i and d; iv &amp; dv; i and not ( d ); Filter ( GetAsNumber ( sds &amp;  iv ); &#8220;1234567890&#8221; ); d; GetAsText ( d ); &#8220;&#8221; ); m = If ( t = 2; If ( e &lt; 3; e; Mod ( e; 3 ) ); 0 ); dvv = Middle ( n; 2 + m; Length ( n ) ); n = If ( t = 2 and IsEmpty ( dvv ); n &amp; Left ( &#8220;000&#8221;; 1 + m &#8211; Length ( n ) ); n ); e = If ( t = 2; Div ( e; 3 ) * 3; e ) ];<br \/>\nLeft ( n; 1 + m ) &amp; If ( IsEmpty ( dvv ); &#8220;&#8221;; sds &amp; Middle ( n; 2 + m; Length ( n ) ) ) &amp; If ( e &gt; 0; &#8220;e&#8221; &amp; e; &#8220;&#8221; ) );&lt;br \/&gt;<br \/>\n\/\/****** Default as non-exponential number.&lt;br \/&gt;<br \/>\niv &amp; Case (&lt;br \/&gt;<br \/>\nIsEmpty ( GetValue ( opt; 2 ) ); &#8220;&#8221;; \/\/****** No decimal requested.&lt;br \/&gt;<br \/>\nIsEmpty ( dgt ); \/\/****** Show full decimal&lt;br \/&gt;<br \/>\nGetValue ( opt; 2 ) &amp; dv;&lt;br \/&gt;<br \/>\ndgt &gt; 0; \/\/****** Append count (dgt) of zeros to decimal.&lt;br \/&gt;<br \/>\nGetValue ( opt; 2 ) &amp; If ( GetAsBoolean ( GetValue ( opt; 5 ) ); Left ( dv &amp; Substitute ( 10 ^ dgt &#8211; 1 ; 9 ; 0 ) ; dgt ); dv );&lt;br \/&gt;<br \/>\n\/\/****** Default, dgt (precision) is &#8216;0&#8217; so no decimal.&lt;br \/&gt;<br \/>\n&#8220;&#8221; ) ) );&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* NUMBER SIGNS AND NOTATIONS. Positioned where requested. *\/&lt;br \/&gt;<br \/>\nres = If ( boo or IsEmpty ( res ); res; Let ( [ sl = GetValue ( opt; 6 ); sr = GetValue ( opt; 7 ); nl = GetValue ( opt; 10 ); nr = GetValue ( opt; 11 ) ];&lt;br \/&gt;<br \/>\nIf ( neg; If ( GetAsBoolean ( GetValue ( opt; 8 ) ); nl &amp; sl ; sl &amp; nl ) &amp; res &amp; If ( GetAsBoolean ( GetValue ( opt; 9 ) ); sr &amp; nr; nr &amp; sr ); \/\/ End of negative.&lt;br \/&gt;<br \/>\nnl &amp; res &amp; nr ) ) ); \/\/ Case default .&lt;\/p&gt;<br \/>\n&lt;p&gt;\/* NUMBER COLOR. Get, confirm, and apply RGB colors to result. *\/&lt;br \/&gt;<br \/>\nres = If ( neg; Let ( [ c = LeftValues ( Substitute ( GetValue ( opt; 12 ) &amp; &#8220;,,&#8221;; [ &#8220;,&#8221;; &#8220;\u00b6&#8221; ] ); 3 ); r = GetAsNumber ( GetValue ( c; 1 ) ); r = If ( r &gt; -1 and r &lt; 256; r; 0 ); g = GetAsNumber ( GetValue ( c; 2 ) ); g = If ( g &gt; -1 and g &lt; 256; g; 0 ); b = GetAsNumber ( GetValue ( c; 3 ) ); b = If ( b &gt; -1 and b &lt; 256; b; 0 ) ]; TextColor ( res; RGB ( r; g; b ) ) ); res );<\/p>\n<p>\/\/ HELP TEXT<br \/>\nhlp = If ( fmt \u2260 &#8220;?&#8221;; &#8220;&#8221;; &#8220;FormatNumber ( number, format )\u00b6\u00b6<br \/>\nNUMBER FORMATTING (Ex.: \\&#8221;$,.2\\&#8221;):\u00b6<br \/>\n\t, &#8211; (thousands separator) integer is \\&#8221;thousands separated\\&#8221;.\u00b6<br \/>\n\t. &#8211; (decimal separator) controls display of the number decimal.\u00b6<br \/>\n\t# &#8211; (number) rounding\/truncation precision:\u00b6<br \/>\n \t\t0 &#8211; integer only is displayed. Use to control negative signs and notations positioning.\u00b6<br \/>\n\t\t1&#8230;n &#8211; rounding\/truncation precision of decimal.\u00b6<br \/>\n\t\t. &#8211; decimal separator with no number displays the unaltered number decimal.\u00b6<br \/>\n\t^ &#8211; (caret) formats number in scientific E notation.\u00b6<br \/>\n\t~ &#8211; (tilde) formats number in engineering E notation.\u00b6<br \/>\nNEGATIVE SIGN FORMATTING (Ex.: \\&#8221;.-\\&#8221;):\u00b6<br \/>\n\t&#8211; &#8211; minus sign (default) (default: left).\u00b6<br \/>\n\t&lt;&gt; &#8211; angle brackets (default: left and right).\u00b6&lt;br \/&gt;<br \/>\n\t() &#8211; parentheses (default: left and right).\u00b6&lt;br \/&gt;<br \/>\n\tCR &#8211; credit symbol (default: right).\u00b6&lt;br \/&gt;<br \/>\n\t\u2206 &#8211; delta symbol (default: left). (Dark delta is used.)\u00b6&lt;br \/&gt;<br \/>\nBOOLEAN FORMATTING (Ex.: \\&#8221;Yes||No\\&#8221;).\u00b6&lt;br \/&gt;<br \/>\n\t|| &#8211; Divides boolean results. True number returns left value. False number returns right value.\u00b6&lt;br \/&gt;<br \/>\nNOTATIONS FORMATTING (Ex.: \\&#8221;$.2 dollars\\&#8221;).\u00b6&lt;br \/&gt;<br \/>\n\t% &#8211; percent sign. Force multiply number by 100 (default: right).\u00b6&lt;br \/&gt;<br \/>\n\t$, \u00a3, #, etc. &#8211; dollar, pound, hash, etc. (default: left).\u00b6&lt;br \/&gt;<br \/>\nESCAPED OPTIONS FORMATTING (Ex.: \\&#8221;\\c255,,\\\\\\&#8221;). Enclose each option with escapes, \\\\\\, (backslashes).\u00b6&lt;br \/&gt;<br \/>\n\t\\T &#8211; (text) thousands separator (default: system).\u00b6&lt;br \/&gt;<br \/>\n\t\\D &#8211; (text) decimal separator (default: system).\u00b6&lt;br \/&gt;<br \/>\n\t\\R &#8211; (boolean) rounding on (default: true).\u00b6&lt;br \/&gt;<br \/>\n\t\\Z &#8211; (boolean) show number if zero (default: true).\u00b6&lt;br \/&gt;<br \/>\n\t\\F &#8211; (boolean) pad decimal with zeros to precision (default: true).\u00b6&lt;br \/&gt;<br \/>\n\t\\SL &#8211; (text) negative sign (-, &lt;&gt;, (), CR, \u2206) on left of number (default: minus sign).\u00b6&lt;br \/&gt;<br \/>\n\t\\SR &#8211; (text) negative sign on right of number (default: empty).\u00b6&lt;br \/&gt;<br \/>\n\t\\PL &#8211; (boolean) negative sign on left side is next to number (default: true).\u00b6&lt;br \/&gt;<br \/>\n\t\\PR &#8211; (boolean) negative sign on right side is next to number (default: true).\u00b6&lt;br \/&gt;<br \/>\n\t\\NL &#8211; (text) notation ($, %, #, etc.) on left side of number (default: empty).\u00b6&lt;br \/&gt;<br \/>\n\t\\NR &#8211; (text) notation on right side of number (default: empty).\u00b6&lt;br \/&gt;<br \/>\n\t\\C &#8211; (integers) comma separated RGB number text (#,#,#) to color negative number (default: black).\u00b6&lt;br \/&gt;<br \/>\n\t\\X &#8211; (integer) exponentiation: 0 = none, 1 = scientific, 2 = engineering (default: 0).\u00b6&lt;br \/&gt;<br \/>\n\t\\BP &#8211; (text) positive response to boolean formatting.\u00b6&lt;br \/&gt;<br \/>\n\t\\BN &#8211; (text) negative response to boolean formatting.&#8221;&lt;br \/&gt;<br \/>\n ) \/\/ End of Help Preparation&lt;\/p&gt;<br \/>\n&lt;p&gt;];&lt;\/p&gt;<br \/>\n&lt;p&gt;If ( IsEmpty ( hlp ); res; hlp ) \/\/ Return result.&lt;\/p&gt;<br \/>\n&lt;p&gt;)&lt;\/p&gt;<br \/>\n&lt;p&gt;\/*&lt;br \/&gt;<br \/>\nFormatNumber ( number, format )&lt;\/p&gt;<br \/>\n&lt;p&gt;Returns a text string of the number in the requested format.&lt;\/p&gt;<br \/>\n&lt;p&gt;By Lewis C. Lorenz&lt;br \/&gt;<br \/>\nLast updated: 2\/11\/2014 &lt;\/p&gt;<br \/>\n&lt;p&gt;Function allows complete FileMaker Pro number formatting using an intuitive, liberal format structure. Free-form formatting provides the user flexible control over what is included in the final formatted result. Escaped options can be used instead. Include the following elements in the format string in the order the user desires to produce a formatted number. &lt;\/p&gt;<br \/>\n&lt;p&gt;HELP:&lt;br \/&gt;<br \/>\nPassing &#8216;?&#8217; as the only content of &#8216;format&#8217; returns a shortened version of this text.&lt;\/p&gt;<br \/>\n&lt;p&gt;NUMBER FORMATTING:&lt;br \/&gt;<br \/>\n\t, &#8211; (thousands separator) integer portion of the number is &#8220;thousands separated&#8221;.&lt;br \/&gt;<br \/>\n\t. &#8211; (decimal separator) displays of the decimal portion of the number.&lt;br \/&gt;<br \/>\n\t# &#8211; (number) specifies the rounding precision (controls the count of decimal number digits to display):&lt;br \/&gt;<br \/>\n \t\t0 &#8211; number decimal and decimal separator is not displayed. Enables positioning of negative signs and notations.&lt;br \/&gt;<br \/>\n\t\t1&#8230;n &#8211; Truncation and rounding precision of the number decimal.&lt;br \/&gt;<br \/>\n\t\t. &#8211; decimal separator only, with no number, displays the unaltered number decimal.&lt;br \/&gt;<br \/>\n\t^ &#8211; (caret) formats number in scientific E notation.&lt;br \/&gt;<br \/>\n\t~ &#8211; (tilde) formats number in engineering E notation.&lt;\/p&gt;<br \/>\n&lt;p&gt;NEGATIVE SIGN FORMATTING:&lt;br \/&gt;<br \/>\n\t&#8211; &#8211; minus sign (default) (default: left).&lt;br \/&gt;<br \/>\n\t&lt;&gt; &#8211; angle brackets (default: left and rigth).&lt;br \/&gt;<br \/>\n\t() &#8211; parentheses (default: left and right).&lt;br \/&gt;<br \/>\n\tCR &#8211; credit symbol (default: right).&lt;br \/&gt;<br \/>\n\t\u2206 &#8211; delta symbol (default: left). (Black delta is output.)&lt;br \/&gt;<br \/>\nMinus sign, credit and delta symbols can be displayed on the left or right of the formatted number by placing them to the left or right of an included decimal separator, or zero, in &#8216;format&#8217;. Negative signs are placed at their default location when no decimal separator is included.&lt;\/p&gt;<br \/>\n&lt;p&gt;BOOLEAN FORMATTING:&lt;br \/&gt;<br \/>\n\t|| &#8211; two pipe characters divide boolean results. True number returns left side. False number returns right side.&lt;\/p&gt;<br \/>\n&lt;p&gt;NOTATION FORMATTING:&lt;br \/&gt;<br \/>\n\t% &#8211; percent sign. Inclusion in &#8216;format&#8217; forces multiplication of the number by 100 (default: right).&lt;br \/&gt;<br \/>\n\t$, \u00a3, #, etc. &#8211; dollar, pound, hash, and any other characters, can be included in the formatted number (default: left).&lt;br \/&gt;<br \/>\nPercent, currency and other notations can be placed on either side of the formatted number depending on whether you place them at the left or right of an included decimal separator, or zero, in &#8216;format&#8217;. Notations are placed at their default position when no decimal separator is included. The user must insure that the notations in &#8216;format&#8217; produces the desired formatted result.&lt;\/p&gt;<br \/>\n&lt;p&gt;ESCAPED OPTIONS FORMATTING:&lt;br \/&gt;<br \/>\n\t\\T &#8211; (text) thousands separator (default: system).&lt;br \/&gt;<br \/>\n\t\\D &#8211; (text) decimal separator (default: system).&lt;br \/&gt;<br \/>\n\t\\R &#8211; (boolean) round number to passed precision (default: true).&lt;br \/&gt;<br \/>\n\t\\Z &#8211; (boolean) show number if zero (default: true).&lt;br \/&gt;<br \/>\n\t\\F &#8211; (boolean) fill (pad) decimal with zeros to length of passed precision (default: true).&lt;br \/&gt;<br \/>\n\t\\SL &#8211; (text) negative sign (-, &lt;&gt;, (), CR, \u2206) appearing on left side of number (default: minus sign).&lt;br \/&gt;<br \/>\n\t\\SR &#8211; (text) negative sign (-, &lt;&gt;, (), CR, \u2206) appearing on right side of number (default: empty).&lt;br \/&gt;<br \/>\n\t\\PL &#8211; (boolean) proximity of negative sign on left side is next to number (default: true).&lt;br \/&gt;<br \/>\n\t\\PR &#8211; (boolean) proximity of negative sign on right side is next to number (default: true).&lt;br \/&gt;<br \/>\n\t\\NL &#8211; (text) notation sign ($, %, #, etc.) to appear on left side of number (default: empty).&lt;br \/&gt;<br \/>\n\t\\NR &#8211; (text) notation sign ($, %, #, etc.) to appear on right side of number (default: empty).&lt;br \/&gt;<br \/>\n\t\\C &#8211; (integers) comma-separated RGB number text (#,#,#) to color negative number (default: black).&lt;br \/&gt;<br \/>\n\t\\X &#8211; (integer) exponentiation formatting: 0 = none, 1 = scientific, 2 = engineering (default: 0).&lt;br \/&gt;<br \/>\n\t\\BP &#8211; (text) positive response to boolean formatting.&lt;br \/&gt;<br \/>\n\t\\BN &#8211; (text) negative response to boolean formatting.&lt;br \/&gt;<br \/>\nEscaped options override free-form format, defaults and add formatting. Enclose each option with escape (backslash) characters \\\\\\\\.&lt;\/p&gt;<br \/>\n&lt;p&gt;Examples:&lt;br \/&gt;<br \/>\n\tFormatNumber ( 14725.3675, &#8220;$,.2 US&#8221; ) = $14,725.37 US&lt;br \/&gt;<br \/>\n\tFormatNumber ( -14725.3675, &#8220;$(,.2) US\\r0\\&#8221; ) = $(14,725.36) US [rounding off]&lt;br \/&gt;<br \/>\n\tFormatNumber ( -14725.3675, &#8220;#,.\\c255\\&#8221; ) = #-14,725.3675 [text color is red]&lt;br \/&gt;<br \/>\n\tFormatNumber ( 1, &#8220;Yes||No&#8221; ) = Yes&lt;br \/&gt;<br \/>\n\tFormatNumber ( 5973600, &#8220;^&#8221; ) = 5.9736e6&lt;br \/&gt;<br \/>\n\tFormatNumber ( 59703600, &#8220;~0 kg&#8221; ) = 59.7036e6 kg&lt;br \/&gt;<br \/>\n*\/&lt;!&#8211;\/raw&#8211;&gt;<\/textarea><br \/>\n<input type=\"button\" value=\"Select All\" \/> <input type=\"reset\" value=\"Reset\" \/><\/form><\/p>\n","protected":false},"excerpt":{"rendered":"<p>FormatNumber ( number , format ) FormatNumber is a one-pass FileMaker Pro custom function that formats a number using intuitive, free-form format options that completely mimic FileMaker Pro&#8217;s number data type formatting. Formatting options can also be specified via escaped <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/lorenzcom.com\/?p=165\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10,15,14],"tags":[37,36,17,16],"_links":{"self":[{"href":"https:\/\/lorenzcom.com\/index.php?rest_route=\/wp\/v2\/posts\/165"}],"collection":[{"href":"https:\/\/lorenzcom.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lorenzcom.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lorenzcom.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lorenzcom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=165"}],"version-history":[{"count":69,"href":"https:\/\/lorenzcom.com\/index.php?rest_route=\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":878,"href":"https:\/\/lorenzcom.com\/index.php?rest_route=\/wp\/v2\/posts\/165\/revisions\/878"}],"wp:attachment":[{"href":"https:\/\/lorenzcom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lorenzcom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lorenzcom.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}