Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Quick Quesstion, I have a number that I want to be formatted automatically upon entry to keep everything the same. The number is 11 characters and broken up as 2,3,3,3 or eg 11 111 111 111. Now I have used a calculation 

Let(
@NumbersOnly = Filter(Self; "0123456789");

Case(

Length(@NumbersOnly) = 10;

"("&""&

Left (@NumbersOnly; 2) &")"& "" &" "&


Middle(@NumbersOnly;3;4) & "-" &


Right (@NumbersOnly;4)

))

to format a phone number specifically and that is fine. But for the love of Mike how would I break up thea bove example to the 11 111 111 111 format when enterd as 11111111111

Here's one way:

Let (
digits = Filter ( Self ; "0123456789" )
;
Left ( digits ; 2 ) & " " & Middle ( digits ; 3 ; 3 ) & " " & Middle ( digits ; 6 ; 3 ) & " " & Right  ( digits ; 3 )
)

Here's another:

Let (
digits = Filter ( Self ; "0123456789" ) 
;
Replace ( Replace (  Replace ( 
digits ; 
9 ; 0 ; " " ) ;
6 ; 0 ; " " ) ;
3 ; 0 ; " " )
)

I did not test for length, because you didn't say what should be done when the test fails. In your example, the entry would have been erased - which is kind of cruel to the user.

  • Author

Thanks Comment, I have a cruel streak :) Not really! I hadn't Picked up on that so will look but I will try your suggestion. I guess I wasn't sure how to deal with the 2 middle arguments. I wasnt sure if you could only have 1 instance but from your suggestion it appears that you can "nest" them for want of a better word. Thanks for your help as usual always prompt.

You can concatenate as many Middle() function calls as you need. The name Middle does not refer to your calculation; it refers to the string from which the function will extract a "middle" part  (unlike the Left() or Right() functions, which will only extract a part from one of the string's ends).

 

Edited by comment

  • Author

Got it!. Thanks again comment.

10 hours ago, comment said:

Here's another:


Let (
digits = Filter ( Self ; "0123456789" ) 
;
Replace ( Replace (  Replace ( 
digits ; 
9 ; 0 ; " " ) ;
6 ; 0 ; " " ) ;
3 ; 0 ; " " )
)

 

Nice use of Replace()  !!!!  :-)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.