Skip 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.

Make a number Formated from a unformated number

Featured Replies

So I'm confused on a calculation , I'm not sure if I should use a substitute calculation for what I'm trying to do or how to use that calculation by formatting a unformatted number;

Example Unformatted Number 21100

Example Formatted Number 02-1100

So I need to add a "0" in front of the number and then always separate the first two numbers with a "-" the numbers be hide the "-" could be 1 or 20 numbers

Ideas?

"0" & Left ( Table::number ; 1 ) & "-" & Right ( Table::number ; Length ( Table::number ) - 1 )

1 hour ago, WSaxton said:

Example Unformatted Number 21100

The example is ambiguous - it would be preferable to state a rule first, then give examples. For example, will the given number always have exactly 5 digits? If not, what is the expected answer in each case?

---

If I am guessing correctly, you want to do:

SerialIncrement ( "00" ; Div ( Number ; 10000 ) ) & SerialIncrement ( "-0000" ; Mod ( Number ; 10000 ) )  

which would format:

1 as "00-0001";
12 as "00-0012";
123 as "00-0123";
1234 as "00-1234";
12345 as "01-2345";
123456 as "12-3456";
1234567 as "123-4567".

 

 

 

Edited by comment

And if there is always a dash (in the middle) then it truly is not a number so the result calculation should be text.

In fact, I would ask the purpose of this number?  Is it from an export from external source?  I ask because it might be best to auto-enter the correct format to begin with or use OnObjectValidate to assist/force the User in formatting it. 

Edited by LaRetta

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.