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.

Number calc zero being eliminated from calc.

Featured Replies

I am creating some fields like phone number.

Here is what I have phone1 , phone2, phone3.

The calc is phone1 & -phone2 & -phone3

if one of the numbers begin with a 0 it elimates its.

Example:

fiedls 800-XXX-0XXX

Views 800-XXX-XXX

How can I get around it?

All fields are number fields. I tried text fields with same results.

First of all 800-123-4567 is NOT a valid number and must be stored as text. Filemaker stripping the leading 0 out of the data would be the expected result, although since this is an invalid number in the first place.

Second, I cannot think of any concievable situation where Filemaker will strip a 0 out of a text field. Assuming that you simply switched the field back and forth between text and number, the 0 will never be restored, as it was never stored in the first place.

Set the field as text and re-enter the correct phone numbers.

Found the following calc to be quite useful from JMO:

Involves two fields: (a) Phone Number (B) Phone Filter

Field (: is transparent and overlayed field (a). No entry allowed on field (: also take out of tab order.

"(" & Left(Abs(TextToNum(Phone Number)),3) & ") "

& Middle(Abs(TextToNum(Phone Number)),4,3) &

"-" & Right(Abs(TextToNum(Phone Number)),4)

Users type 8001234567 and (800) 123-4567 is displayed. Will always display leading zeros.

Here's the calc I use for formatting telephone numbers from text fields. Although a bit longer than other examples, it works reliably and under different conditions (no area code, 1 + Area Code, etc.)B)

Case(Length(LeftWords(Substitute(FieldName, "-", ""), 1)) = 11,

Left(Substitute(FieldName, "-", ""), 1) & "-" & Middle(Substitute(FieldName, "-", ""), 2, 3) & "-" & Middle(Substitute(FieldName, "-", ""), 5, 3) & "-" & Middle(Substitute(FieldName, "-", ""), 8, 4) & Right(FieldName, Length(Substitute(FieldName, "-", "")) - 11),

Length(LeftWords(Substitute(FieldName, "-", ""), 1)) = 10,

Left(Substitute(FieldName, "-", ""), 3) & "-" & Middle(Substitute(FieldName, "-", ""), 4, 3) & "-" & Middle(Substitute(FieldName, "-", ""), 7, 4) & Right(FieldName, Length(Substitute(FieldName, "-", "")) - 10),

Length(LeftWords(Substitute(FieldName, "-", ""), 1)) = 7,

Left(Substitute(FieldName, "-", ""), 3) & "-" & Middle(Substitute(FieldName, "-", ""), 4, 4) & Right(FieldName, Length(Substitute(FieldName, "-", "")) - 7)

,

FieldName

)

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.