Number Formatting Function

9 messages Options
Embed this post
Permalink
Danny Lopez

Number Formatting Function

Reply Threaded More More options
Print post
Permalink
Hello,

Does anyone know how to transform 123456.78 to "123,456.78"?

I need a function which transforms a number into this format of text.

Thanks in advance.
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Jonathan Fletcher

Re: Number Formatting Function

Reply Threaded More More options
Print post
Permalink
Danny,

This one on Brian Dunning's site is little overkill but it'll do the  
job:
<http://www.briandunning.com/cf/871>

j.

On Oct 20, 2009, at 5:25 AM, Danny Lopez wrote:

> Hello,
>
> Does anyone know how to transform 123456.78 to "123,456.78"?
>
> I need a function which transforms a number into this format of text.
>
> Thanks in advance.
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au


--
Jonathan Fletcher
FileMaker 9 & 10 Certified Developer
****NEW Ph no: 502-509-7137****

Project Foreman
NewMedia Construction Co.
[hidden email]

Instigator
The BB&J Network
The "Go-To Guys" for
FileMaker Development in Louisville
www.thebbandj.net

FileMaker Louisville Blog:
http://filemakerlouisville.posterous.com



_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Danny Lopez

Re: [Filemaker_Pro] Number Formatting Function

Reply Threaded More More options
Print post
Permalink
In reply to this post by Danny Lopez
Thanks a lot to all of you!!!


On Tue, Oct 20, 2009 at 6:38 PM, Rahul <[hidden email]> wrote:

>
>
> Danny,
>
> This should do the trick:
> The Custom Function has a single argument called FormatMe. You need to pass
> the number you want to format and it will return the formatted number. Hope
> this helps... Cheers!
>
> Let(
> [$s = Round(FormatMe;2);
> $st = GetAsText ( Int($s));
> $format = GetAsText($s - $st);
> $use = Case(Length($format) = 2; $format &"0";Length($format) =
> 3;$format;Length($format) > 3; Round($format;2);$format=0;".00")
> ];
> Case(
> $s < 1000; $st & $use;
> $s < 10000 and $s > 999; Left($st;1) & "," & Right($st;3) & $use;
> $s  ≥ 10000 and $s   ≤ 99999; Left($st;2) & "," & Right($st;3) & $use;
> $s  ≥ 100000 and $s   ≤ 999999; Left($st;3) & "," & Right($st;3) & $use;
> $s  ≥ 1000000 and $s   ≤ 9999999; Left($st;1) & "," & Middle($st;2;3) & ","
> & Right($st;3) & $use;
> $s  ≥ 10000000 and $s   ≤ 99999999; Left($st;2) & "," & Middle($st;3;3) &
> "," & Right($st;3) & $use;
> $st & $use
> ))
>
> On Tue, Oct 20, 2009 at 2:55 PM, Danny Lopez <[hidden email]> wrote:
>
>>
>>
>> Hello,
>>
>> Does anyone know how to transform 123456.78 to "123,456.78"?
>>
>> I need a function which transforms a number into this format of text.
>>
>> Thanks in advance.
>>
>>
>  __._,_.___
>   Messages in this topic
> <http://groups.yahoo.com/group/Filemaker_Pro/message/7980;_ylc=X3oDMTMyODhwMW5oBF9TAzk3MzU5NzE0BGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRtc2dJZAM3OTgxBHNlYwNmdHIEc2xrA3Z0cGMEc3RpbWUDMTI1NjAzNTEyNgR0cGNJZAM3OTgw>(
> 2)  Reply (via web post)
> <http://groups.yahoo.com/group/Filemaker_Pro/post;_ylc=X3oDMTJuMWFkNzdhBF9TAzk3MzU5NzE0BGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRtc2dJZAM3OTgxBHNlYwNmdHIEc2xrA3JwbHkEc3RpbWUDMTI1NjAzNTEyNg--?act=reply&messageNum=7981>| Start
> a new topic
> <http://groups.yahoo.com/group/Filemaker_Pro/post;_ylc=X3oDMTJjY2pqaXBnBF9TAzk3MzU5NzE0BGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDZnRyBHNsawNudHBjBHN0aW1lAzEyNTYwMzUxMjY->
>  Messages<http://groups.yahoo.com/group/Filemaker_Pro/messages;_ylc=X3oDMTJjbThiNmVoBF9TAzk3MzU5NzE0BGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDZnRyBHNsawNtc2dzBHN0aW1lAzEyNTYwMzUxMjU->|
> Files<http://groups.yahoo.com/group/Filemaker_Pro/files;_ylc=X3oDMTJkM3ZyMDBqBF9TAzk3MzU5NzE0BGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDZnRyBHNsawNmaWxlcwRzdGltZQMxMjU2MDM1MTI1>|
> Photos<http://groups.yahoo.com/group/Filemaker_Pro/photos;_ylc=X3oDMTJjcXAyNHFlBF9TAzk3MzU5NzE0BGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDZnRyBHNsawNwaG90BHN0aW1lAzEyNTYwMzUxMjU->|
> Links<http://groups.yahoo.com/group/Filemaker_Pro/links;_ylc=X3oDMTJkbGg2Z3VhBF9TAzk3MzU5NzE0BGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDZnRyBHNsawNsaW5rcwRzdGltZQMxMjU2MDM1MTI1>|
> Database<http://groups.yahoo.com/group/Filemaker_Pro/database;_ylc=X3oDMTJhMGtubzRvBF9TAzk3MzU5NzE0BGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDZnRyBHNsawNkYgRzdGltZQMxMjU2MDM1MTI1>|
> Polls<http://groups.yahoo.com/group/Filemaker_Pro/polls;_ylc=X3oDMTJkcGs4cmEyBF9TAzk3MzU5NzE0BGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDZnRyBHNsawNwb2xscwRzdGltZQMxMjU2MDM1MTI1>|
> Members<http://groups.yahoo.com/group/Filemaker_Pro/members;_ylc=X3oDMTJjaWlhYjI5BF9TAzk3MzU5NzE0BGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDZnRyBHNsawNtYnJzBHN0aW1lAzEyNTYwMzUxMjU->|
> Calendar<http://groups.yahoo.com/group/Filemaker_Pro/calendar;_ylc=X3oDMTJiZ2RiZHRoBF9TAzk3MzU5NzE0BGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDZnRyBHNsawNjYWwEc3RpbWUDMTI1NjAzNTEyNQ-->
>  The opinions expressed in this email are those of the author, but not
> necessarily those of OneList, this list server, or the publishers or authors
> of this list.  This list does not believe in SPAM, and we ask that you not
> refer to our site when sending SPAM.  Thank you in advance for your
> cooperation with these requests.
>  [image: Yahoo! Groups]<http://groups.yahoo.com/;_ylc=X3oDMTJiazdnajZvBF9TAzk3NDc2NTkwBGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTI1NjAzNTEyNg-->
> Change settings via the Web<http://groups.yahoo.com/group/Filemaker_Pro/join;_ylc=X3oDMTJkcWppc290BF9TAzk3NDc2NTkwBGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDZnRyBHNsawNzdG5ncwRzdGltZQMxMjU2MDM1MTI2>(Yahoo! ID required)
> Change settings via email: Switch delivery to Daily Digest<[hidden email]?subject=Email+Delivery:+Digest>| Switch
> format to Traditional<[hidden email]?subject=Change+Delivery+Format:+Traditional>
>  Visit Your Group
> <http://groups.yahoo.com/group/Filemaker_Pro;_ylc=X3oDMTJiZ3YxaHAxBF9TAzk3NDc2NTkwBGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDZnRyBHNsawNocGYEc3RpbWUDMTI1NjAzNTEyNg-->| Yahoo!
> Groups Terms of Use <http://docs.yahoo.com/info/terms/> | Unsubscribe
> <[hidden email]?subject=>
>    Recent Activity
>
>
>  Visit Your Group
> <http://groups.yahoo.com/group/Filemaker_Pro;_ylc=X3oDMTJjaDd0MjRxBF9TAzk3MzU5NzE0BGdycElkAzMzODEyBGdycHNwSWQDMTcwNTAwNzE4MQRzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzEyNTYwMzUxMjU->
>   Give Back
>
> Yahoo! for Good<http://us.lrd.yahoo.com/_ylc=X3oDMTJrZXUzNjd1BF9TAzk3MzU5NzE0BF9wAzEEZ3JwSWQDMzM4MTIEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNuY21vZARzbGsDYnJhbmQEc3RpbWUDMTI1NjAzNTEyNQ--;_ylg=1/SIG=11314uv3k/**http%3A//brand.yahoo.com/forgood>
>
> Get inspired
>
> by a good cause.
>  Y! Toolbar
>
> Get it Free!<http://us.lrd.yahoo.com/_ylc=X3oDMTJtcHEwdnBpBF9TAzk3MzU5NzE0BF9wAzIEZ3JwSWQDMzM4MTIEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNuY21vZARzbGsDdG9vbGJhcgRzdGltZQMxMjU2MDM1MTI1;_ylg=1/SIG=11c6dvmk9/**http%3A//toolbar.yahoo.com/%3F.cpdl=ygrps>
>
> easy 1-click access
>
> to your groups.
>  Yahoo! Groups
>
> Start a group<http://groups.yahoo.com/start;_ylc=X3oDMTJtamQ1MTgzBF9TAzk3MzU5NzE0BF9wAzMEZ3JwSWQDMzM4MTIEZ3Jwc3BJZAMxNzA1MDA3MTgxBHNlYwNuY21vZARzbGsDZ3JvdXBzMgRzdGltZQMxMjU2MDM1MTI1>
>
> in 3 easy steps.
>
> Connect with others.
>   .
>
> __,_._,___
>
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
David Haney

Re: Number Formatting Function

Reply Threaded More More options
Print post
Permalink
In reply to this post by Danny Lopez
Danny Lopez,

You wrote...

> Does anyone know how to transform 123456.78 to "123,456.78"?
> I need a function which transforms a number into this format of text.

(1) For the exact length shown...

Left ( num ; 3 ) & ","  & Middle ( num ; 4 ; 3 ) & Right ( num ; 3 )

(2) For multiple lengths of a number AND assuming a decimal is always
entered...

Case (

Length ( num ) = 3 ; Right ( num ; 3 ) ;
Length ( num ) = 4 ; Left ( num ; 1 ) & Right ( num ; 3 ) ;
Length ( num ) = 5 ; Left ( num ; 2 ) & Right ( num ; 3 ) ;
Length ( num ) = 6 ; Left ( num ; 3 ) & Right ( num ; 3 ) ;
Length ( num ) = 7 ; Left ( num ; 1 ) & ","  & Middle ( num ; 4 ; 3 ) &
Right ( num ; 3 ) ;
Length ( num ) = 8 ; Left ( num ; 2 ) & ","  & Middle ( num ; 4 ; 3 ) &
Right ( num ; 3 ) ;
Length ( num ) = 9 ; Left ( num ; 3 ) & ","  & Middle ( num ; 4 ; 3 ) &
Right ( num ; 3 ) ;
Length ( num ) = 10 ; Left ( num ; 1 ) & ","  & Middle ( num ; 4 ; 3 ) & ","
& Middle ( num ; 4 ; 3 ) & Right ( num ; 3 ) ;
Length ( num ) = 11 ; Left ( num ; 2 ) & ","  & Middle ( num ; 4 ; 3 ) & ","
& Middle ( num ; 4 ; 3 ) & Right ( num ; 3 ) ;
Length ( num ) = 12 ; Left ( num ; 3 ) & ","  & Middle ( num ; 4 ; 3 ) & ","
& Middle ( num ; 4 ; 3 ) & Right ( num ; 3 ) ;
Length ( num ) = 13 ; Left ( num ; 1 ) & "," & Middle ( num ; 4 ; 3 ) &  ","
& Middle ( num ; 4 ; 3 ) & ","  & Middle ( num ; 4 ; 3 ) & Right ( num ; 3 )
;
Length ( num ) = 14 ; Left ( num ; 2 ) & "," & Middle ( num ; 4 ; 3 ) &  ","
& Middle ( num ; 4 ; 3 ) & ","  & Middle ( num ; 4 ; 3 ) & Right ( num ; 3 )
;
Length ( num ) = 15 ; Left ( num ; 3 ) & "," & Middle ( num ; 4 ; 3 ) &  ","
& Middle ( num ; 4 ; 3 ) & ","  & Middle ( num ; 4 ; 3 ) & Right ( num ; 3 )
;
Length ( num ) = 16 ; Left ( num ; 1 ) & "," & Middle ( num ; 4 ; 3 ) & ","
& Middle ( num ; 4 ; 3 ) & "," &  Middle ( num ; 4 ; 3 ) & ","  & Middle (
num ; 4 ; 3 ) & Right ( num ; 3 ) ;

)

There's other alternative but that should get you on your way...

David Haney
ADVANCED DATABASE SYSTEMS (ADS)
http://database-systems.com
http://filemakeraccounting.com
[hidden email]
(480) 588-8055
---------------------------------------
10323533 (ICQ)
davidhaney (Skype)
davidhaney (MAC)
david123haney (AIM)
david123haney (Gmail)
david123haney (Yahoo)
[hidden email] (MSN)


_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Danny Lopez

Re: [Filemaker_Pro] Number Formatting Function

Reply Threaded More More options
Print post
Permalink
In reply to this post by Danny Lopez
When I was still programming in Clipper (so many years ago), this could be
solved only by saying:

transform(1234567.89,"###,###,###.##")

oh well.. different strokes for different folks...

thanks again for all of your responses... i really appreciate them.
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Lee Smith-5

Re: [Filemaker_Pro] Number Formatting Function

Reply Threaded More More options
Print post
Permalink
Hi Danny,

Just want to point out, in case you didn't know it, that you can  
format the number in Layout Mode to display as you desire.  If you  
need it for export,  use the option of use Format for Current Layout.
You can also format a "merge" field to display like this.

HTH

Lee

On Oct 20, 2009, at 5:17 PM, Danny Lopez wrote:

> When I was still programming in Clipper (so many years ago), this  
> could be
> solved only by saying:
>
> transform(1234567.89,"###,###,###.##")
>
> oh well.. different strokes for different folks...
>
> thanks again for all of your responses... i really appreciate them.
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
CobaltSky

Re: [Filemaker_Pro] Number Formatting Function

Reply Threaded More More options
Print post
Permalink
In reply to this post by Danny Lopez
Hi Danny,

If you don't mind about the form of the underlying data, only how it  
looks in the display, Lee's suggestion of using number formatting in  
Layout mode will provide you with an easy solution.

Failing that:

> When I was still programming in Clipper (so many years ago), this  
> could be
> solved only by saying:
>
> transform(1234567.89,"###,###,###.##")

It can of course be done that way in FileMaker if you prefer. Here's  
an example of a custom function that will do that:


      //  SYNTAX:   transform ( SourceString; NumberMask )
     //   ORIGIN:     http://www.nightwing.com.au/FileMaker
    //    NOTES:      Applies a fixed number mask to the digits found  
in the source string
   //                      (regardless of value or decimal position)
  //     VERSION:   1.0v1
//      © 2009 Ray Cologon, NightWing Enterprises, Melbourne, Australia

Let([
p1 = Position(NumberMask; "#"; Length(NumberMask); -1);
n1 = Filter(GetAsText(SourceString); "0123456789");
n2 = Length(n1)];
If(
n2; transform(Left(n1; n2 - 1); Replace(NumberMask; p1; p1 > 0;  
Right(n1; 1)));
Right(NumberMask; Length(NumberMask) - p1)
)
)

As noted, this particular CF doesn't attempt to resolve the placement  
of the decimal. It merely pulls the literal digits from the source  
string you supply and "pours" them into the "mold" of the ## mask you  
specify. It can be adapted to work pretty much however you like (this  
is FileMaker, after all ;)).

Regards,
Ray
------------------------------------------------
R J Cologon, Ph.D.
FileMaker Certified Developer
Author, FileMaker Pro 10 Bible
NightWing Enterprises, Melbourne, Australia
Email: [hidden email]
http://www.nightwing.com.au/FileMaker
------------------------------------------------


Lee's comment about layout mode display formatting, FileMaker can of  
course

On 21/10/2009, at 11:17 AM, Danny Lopez wrote:

> When I was still programming in Clipper (so many years ago), this  
> could be
> solved only by saying:
>
> transform(1234567.89,"###,###,###.##")
>
> oh well.. different strokes for different folks...
>
> thanks again for all of your responses... i really appreciate them.
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Bart Bartholomay

Re: [Filemaker_Pro] Number Formatting Function

Reply Threaded More More options
Print post
Permalink
Hey, Ray -

Good to see you lurkin'.

Cheers, mate.

Bart

Bart Bartholomay
HAB Marketing
3725 8th Lane
Vero Beach, FL 32960
772.299.6352
Filemaker Business Alliance
http://HABMarketing.com




On Oct 20, 2009, at 9:09 PM, [hidden email] wrote:

> Hi Danny,
>
> If you don't mind about the form of the underlying data, only how it  
> looks in the display, Lee's suggestion of using number formatting in  
> Layout mode will provide you with an easy solution.
>
> Failing that:
>
>> When I was still programming in Clipper (so many years ago), this  
>> could be
>> solved only by saying:
>>
>> transform(1234567.89,"###,###,###.##")
>
> It can of course be done that way in FileMaker if you prefer. Here's  
> an example of a custom function that will do that:
>
>
>     //  SYNTAX:   transform ( SourceString; NumberMask )
>    //   ORIGIN:     http://www.nightwing.com.au/FileMaker
>   //    NOTES:      Applies a fixed number mask to the digits found  
> in the source string
>  //                      (regardless of value or decimal position)
> //     VERSION:   1.0v1
> //      © 2009 Ray Cologon, NightWing Enterprises, Melbourne,  
> Australia
>
> Let([
> p1 = Position(NumberMask; "#"; Length(NumberMask); -1);
> n1 = Filter(GetAsText(SourceString); "0123456789");
> n2 = Length(n1)];
> If(
> n2; transform(Left(n1; n2 - 1); Replace(NumberMask; p1; p1 > 0; Right
> (n1; 1)));
> Right(NumberMask; Length(NumberMask) - p1)
> )
> )
>
> As noted, this particular CF doesn't attempt to resolve the  
> placement of the decimal. It merely pulls the literal digits from  
> the source string you supply and "pours" them into the "mold" of the  
> ## mask you specify. It can be adapted to work pretty much however  
> you like (this is FileMaker, after all ;)).
>
> Regards,
> Ray
> ------------------------------------------------
> R J Cologon, Ph.D.
> FileMaker Certified Developer
> Author, FileMaker Pro 10 Bible
> NightWing Enterprises, Melbourne, Australia
> Email: [hidden email]
> http://www.nightwing.com.au/FileMaker
> ------------------------------------------------
>
>
> Lee's comment about layout mode display formatting, FileMaker can of  
> course
>
> On 21/10/2009, at 11:17 AM, Danny Lopez wrote:
>> When I was still programming in Clipper (so many years ago), this  
>> could be
>> solved only by saying:
>>
>> transform(1234567.89,"###,###,###.##")
>>
>> oh well.. different strokes for different folks...
>>
>> thanks again for all of your responses... i really appreciate them.
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Richard DeShong

RE: Number Formatting Function

Reply Threaded More More options
Print post
Permalink
In reply to this post by David Haney
To put comma's into the integer part,
I find the following to much easier to look at.
Also the logic is easy to convert to a CF is you want
to use it in a field def.

Set Variable [$IsNeg; case(getasnumber($n) < 0; 1; 0 )]
Set Variable [$n; Abs($n)]
Set Variable [$intNum; Int($n)]
If [Length($intNum) > 3]
  Set Variable [$intNum;
     left($intNum;length($intNum)-3) & "," & right($intNum;3)]
  If [Length($intNum) > 7]
     Set Variable [$intNum;
        left($intNum;length($intNum)-7) & "," & right($intNum;7)]
    If [Length($intNum) > 11]
      Set Variable [$intNum;
        left($intNum;length($intNum)-11) & "," & right($intNum;11)]
    EndIf
  EndIf
EndIf

that'll take you out to 999,999,999,999

To add the decimal part (with $dPlace = # of decimal places):

Set Variable [$dZeros; left("000000000000"; $dPlaces)]
Set Variable [$dValue; getasnumber($n) - getasnumber($intNum)]
If [Getasnumber($dValue) = 0]
   Set Variable [$dPart; "." & $dZeros]
Else
   Set Variable [$dPart; "." &
      middle(getastext(round(getasnumber($dValue);$dPlaces)) &
      $dZeros; 2; $dPlaces )]
EndIf
Set Variable [$returnStr; $intNum & $dPart]

You can throw in a $ sign, and decide where you want to add
a minus sign, using $IsNeg.


-----Original Message-----
From: David Haney Sent: Tuesday, October 20, 2009 5:02 PM

Danny Lopez,
You wrote...
> Does anyone know how to transform 123456.78 to "123,456.78"?
> I need a function which transforms a number into this format of text.
(1) For the exact length shown...
Left ( num ; 3 ) & ","  & Middle ( num ; 4 ; 3 ) & Right ( num ; 3 )
(2) For multiple lengths of a number AND assuming a decimal is always
entered...

Case (

Length ( num ) = 3 ; Right ( num ; 3 ) ;
Length ( num ) = 4 ; Left ( num ; 1 ) & Right ( num ; 3 ) ;
Length ( num ) = 5 ; Left ( num ; 2 ) & Right ( num ; 3 ) ;
Length ( num ) = 6 ; Left ( num ; 3 ) & Right ( num ; 3 ) ;
Length ( num ) = 7 ; Left ( num ; 1 ) & ","  & Middle ( num ; 4 ; 3 ) &
Right ( num ; 3 ) ;
Length ( num ) = 8 ; Left ( num ; 2 ) & ","  & Middle ( num ; 4 ; 3 ) &
Right ( num ; 3 ) ;
Length ( num ) = 9 ; Left ( num ; 3 ) & ","  & Middle ( num ; 4 ; 3 ) &
Right ( num ; 3 ) ;
Length ( num ) = 10 ; Left ( num ; 1 ) & ","  & Middle ( num ; 4 ; 3 ) & ","
& Middle ( num ; 4 ; 3 ) & Right ( num ; 3 ) ;
Length ( num ) = 11 ; Left ( num ; 2 ) & ","  & Middle ( num ; 4 ; 3 ) & ","
& Middle ( num ; 4 ; 3 ) & Right ( num ; 3 ) ;
Length ( num ) = 12 ; Left ( num ; 3 ) & ","  & Middle ( num ; 4 ; 3 ) & ","
& Middle ( num ; 4 ; 3 ) & Right ( num ; 3 ) ;
Length ( num ) = 13 ; Left ( num ; 1 ) & "," & Middle ( num ; 4 ; 3 ) &  ","
& Middle ( num ; 4 ; 3 ) & ","  & Middle ( num ; 4 ; 3 ) & Right ( num ; 3 )
;
Length ( num ) = 14 ; Left ( num ; 2 ) & "," & Middle ( num ; 4 ; 3 ) &  ","
& Middle ( num ; 4 ; 3 ) & ","  & Middle ( num ; 4 ; 3 ) & Right ( num ; 3 )
;
Length ( num ) = 15 ; Left ( num ; 3 ) & "," & Middle ( num ; 4 ; 3 ) &  ","
& Middle ( num ; 4 ; 3 ) & ","  & Middle ( num ; 4 ; 3 ) & Right ( num ; 3 )
;
Length ( num ) = 16 ; Left ( num ; 1 ) & "," & Middle ( num ; 4 ; 3 ) & ","
& Middle ( num ; 4 ; 3 ) & "," &  Middle ( num ; 4 ; 3 ) & ","  & Middle (
num ; 4 ; 3 ) & Right ( num ; 3 ) ;

)

There's other alternative but that should get you on your way...

David Haney
ADVANCED DATABASE SYSTEMS (ADS)
http://database-systems.com
http://filemakeraccounting.com
[hidden email]
(480) 588-8055
---------------------------------------
10323533 (ICQ)
davidhaney (Skype)
davidhaney (MAC)
david123haney (AIM)
david123haney (Gmail)
david123haney (Yahoo)
[hidden email] (MSN)


_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au


_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au