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.

LeftRight Function

Featured Replies

I have two fields: Centimeters and Inches. I am trying to type in one (and vise versa), example (CM): 55-58 and then auto populate (IN) to 21.65-22.83. I was thinking using left or right function, but maybe there will be 3 or more digits in between the (-) symbol. What would be a good way to identify those digits in this case, so that I can apply the conversion vs script?

 

Thanks

Use substitute to convert the hyphen to a return, then you can get the different numbers with GetValue:

Let ( [
    _values = Substitute ( Table::field ; "-" ; ¶ ) ;
    _left = GetValue ( _values ; 1 ) ;
    _right = GetValue ( _values ; 2 ) ;
] ;
    /* ... */
)

Ideally, you would have four fields: Min_cm, Max_cm, Min_in and Max_in, and they would all be Number fields.

To do it with only two (Text) fields, as shown in your example, you could make the IN field auto-enter a calculated value (replacing existing value) =

If (
Get ( ActiveFieldTableName ) & "::" & Get ( ActiveFieldName ) = GetFieldName ( Self ) ; Self ;
Let ( [
v =  Substitute ( CM ; "-" ; ¶ ) ;
min = GetValue ( v ; 1 ) / 2.54 ;
max = GetValue ( v ; 2 ) / 2.54
] ;
Round ( min ; 2 ) & "-" & Round ( max ; 2 )
)
)

and a similar formula for the CM field. No scripts are required for this.

This assumes there will always be two values in the source field, separated by a hyphen - otherwise more work will be required to prevent the result being displayed as "21.65-0".

 

Edited by comment

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.