
1. Re: A bad Case of PatternCount(s) and GetAsNumbers
philmodjunk Jun 14, 2011 2:55 PM (in response to damondidit)Why do you need to add the thousands separator in this fashion?
Let ( [ N = GetAsNumber ( OriginalNumbers) ;
GT = If ( PatternCount ( OriginalNumbers; "<" ) ; "<" )
] ;
GT & If ( N >= 1000 ; Div ( N ; 1000 ) & "," & Right ( "00" & Mod ( N ; 1000 ) ; 3 ) ; N )
)Let ( [ N = GetAsNumber ( OriginalNumbers) ;
GT = If ( PatternCount ( OriginalNumbers; "<" ) ; "<" )
] ;
GT & If ( N >= 1000 ; Div ( N ; 1000 ) & "," & Right ( "00" & Mod ( N ; 1000 ) ; 3 ) ; N )
)The thousands separator can be part of the number's specified data format on the layout and if this is the only reason for needing the 1000's separator, you can then use that data format on your label and use two calculation fields:
cGT: If ( PatternCount ( OriginalNumbers; "<" ) ; "<" )
cCleanedNumber: getasnumber ( originalnumbers )
On your layout you can put the two fields together to display the desired result, most likely by using them as merge fields.
<<YourTable::cGT>><<YourTable::cCleanedNumber>>

2. Re: A bad Case of PatternCount(s) and GetAsNumbers
damondidit Jul 1, 2011 4:27 PM (in response to damondidit)Thank you for your help Phil.
This is where I am, just need to work on getting the second thousands separator to work. Right now it is eating one of my zeroes.
Let ( [ N = GetAsNumber (OriginalNumbers );
GT = If(PatternCount (OriginalNumbers;"<");"<");
JF = If (PatternCount (OriginalNumbers;"J");"J");
DD = If(PatternCount (OriginalNumbers;"");"");
ND = If(Exact ( OriginalNumbers ; "ND");"ND");
z0 = If(IsEmpty (OriginalNumbers);"")
];
GT &
If ( N >= 1000 ; Div ( N ; 1000 ) & "," & Right ( "00" & Mod ( N ; 1000 ) ; 3 ) ; N )
& DD & ND & z0 & JF)

3. Re: A bad Case of PatternCount(s) and GetAsNumbers
damondidit Jul 5, 2011 5:01 PM (in response to damondidit)I'm all right now, here is what I ended up with:
Let ( [ N = GetAsNumber (OriginalNumbers );
GT = If(PatternCount (OriginalNumbers;"<");"<");
JF = If (PatternCount (OriginalNumbers;"J");"J");
DD = If(PatternCount (OriginalNumbers;"");"");
ND = If(Exact ( OriginalNumbers ; "ND");"ND");
z0 = If(IsEmpty (OriginalNumbers);"")
];
GT & Case(
N ≥ 1000000; Left ( N ; 1 ) & ","&Middle ( N ; 2 ; 3) & ","& Right ( N ; 3 );
N ≥ 100000; Left ( N ; 3 ) & ","& Right ( N ; 3 );
N ≥ 10000; Left ( N ; 2 ) & ","& Right ( N ; 3 );
N ≥ 1000; Left ( N ; 1 ) & ","& Right ( N ; 3 );N < 1 and N > 0; Left (N; 0) & "0"& N;
N)
& DD & ND & z0 & JF)