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.

Converting text with digit and suffix to numbers

Featured Replies

 I importing a  huge list as text files from FileBuddy which gives me file names, file location and file size fields
Importing the text list in the Filemaker database the "SIZE" field is populated with text so I am unable to sort the sizes as numbers. 

the SIZE field looks as follows: 
EXAMSPLEs
666,73 MB
1,36 GB
432 KB
How to I write a script so the "SIZE" text field can be converted in an integer?
Example of possible results:
if the text field is 921,5 MB the resulting number should be 921500000 
or
if the text field is 2,16 GB the resulting number should be 2160000000 from
or
if the text field is 89 KB the resulting number should be 89000

The syntax in the fields is always the same
digits followed with a space then KB or MB or GB. Some include a ","

Any help highly appreciated

Edited by dkey
editing

You could try this calculation as the option of auto-entering a calc for that field:

Let([
n = GetAsNumber ( Self ) ;
t = RightWords ( Self ; 1 )
] ;
n * 
Case(
t = n ; 1 ;
t = "KB" ; 10^3 ;
t = "MB" ; 10^6 ;
t = "GB" ; 10^9 
)
)

 

  • Author

Thanks a great lot Raybaudi it works like charm .... I really must try and leanr the LET function as it seems to solve all kind of problems

Regards

 

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.