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 field calc with a leading zero

Featured Replies

I would like to have the setField function calc a numeric result with a leading zero. I have tried various ways but no luck.

TextToNum(Right("00"&Max(serial) + 1,2))

TextToNum(Right("00"&NumToText(Max(serial) + 1),2))

Let's say your current serial number is 1234, so the next one would be 1235. Apply your calculation to it Right( "001235", 2 ), and what do you get? 35.

You don't only want the two right-most digits; you want the entire number appended by at least one leading zero. Well, how large is your serial? Let's say it's 6 digits. Now, if you always want a leading zero, then you would need to use Right( "0000000" & serial + 1, 7 ). Otherwise, Right( "000000" & serial + 1, 6 ) will give you a leading zero for all serials up to 99999, which may be satisfactory, and will be consistent.

  • Author

Sorry... the serial number is just a two digit number, but what I am having trouble with is setting the result to a number field. It will always drop the leading zero's.

Sorry rivet, your result will have to be text if you want to show the leading zeros. Unformatted raw numbers in FM will always have leading and training zeros dropped. You can show trailing zeros by formatting the field, but unfortunately leading zeros will still be dropped.

Since you are using this as a serial number you can still do whatever you need to, such as auto-enter serial number, etc. Change the calculation result to text and it will work.

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.