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.

Leading zero before decimal is missing

Featured Replies

Hopefully this is the right place for this question.

I have a calculation field that results in either a number or a number (e.g. "1.2" with a less than sign in front of it (e.g., "<1.1").  I have the calculation round the number to 1 decimal place.  The calculation works but the if the result is "0.9", the field only displays ".9".  How can I force the field to show the leading zero on the decimal (e.g., "0.9" instead of ".9")?

I can't use the inspector to format the result as a decimal, because that removes all of the values with a less than sign entirely (i.e., a field that should appear as "<1.1" will be displayed as empty.

So my questions: 1) what is going on here? and 2) what can I do to force filemaker to show the leading zero in a decimal number"

This is Filemaker 16 Advanced.

 

Thank you!

2 hours ago, metamict said:

what is going on here?

Filemaker removes ALL leading zeros from a number - including the first one:

GetAsNumber ( "0.5" )

returns  .5. 

 

2 hours ago, metamict said:

a calculation field that results in either a number or [not] a number (e.g. "1.2" with a less than sign in front of it (e.g., "<1.1"). 

If the result can be either a number or an expression like "<1.1", then you need to set the calculation's result type to Text. And that means you need to format the resulting number yourself, for example by something like:

Int ( result ) & If ( Mod ( result ; 1 ) ; Mod ( result ; 1 ) )

 

Alternatively, you could calculate the number as number only, format the calculation field to display as Decimal, and use another field to show the sign. But that would work well for display only, not for exporting, for example.

 

  • Author

Thanks so much for information about both questions.  This is really clarifies things for me.  Very much appreciated!

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.