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.

Featured Replies

Hi again

First of all the calculation result is TEXT.

I have tried the Round command but cannot get this to work. Would any one have any ideas on this? At the moment, I have something like 12 decimal places and need to report this on the layout as only 3 or 4 significant figures. It is turning into a bit of a pain!!!

Thanks all

Let (

val = Cosmet2010::Margin of Safety [zz__kf__Cosmet2009RepNum];

Case (not IsEmpty (val); zz__Tab__g & "Margin of Safety Adult 60kg: " & zz__Tab__g & val)

)

Try putting the calc in the Data Viewer, but set it up like this:

Let ( [

rep = zz__kf__Cosmet2009RepNum ;

val = Cosmet2010::Margin of Safety [rep];

roundval = Round( val ; 3 ) ;

tab = zz__Tab__g ;

text = "Margin of Safety Adult 60kg: "

result = Case (not IsEmpty (val); tab & text & tab & roundval )

] ;

result

)

Then you can try swapping out "result" with the other variables to determine where the problem is ("cannot get this to work" is a little vague).

Depends...when you say significant digits, do you mean you want "3" to show up as "3.000"?

I think you may need something a little more complicated.

Try this...

Let([

start = Cosmet2010::Margin of Safety [zz__kf__Cosmet2009RepNum] ;

integer = int ( start ) ;

decimal = start - integer ;

decimal1 = Substitute ( decimal ; "." ; "") ;

decimal2 = Left ( decimal1 & "000" ; 3 ) ;

result = integer & "." & decimal2

];

result

)

The question is indeed not clear. The term "significant figures" has a very precise meaning and I am not at all sure that's what you need.

If you only want to format a number to a fixed number of decimal digits, try:


Let ( 

r = Round ( number ; 3 ) 

;

Int ( r ) & SerialIncrement ( ".000" ; Mod ( r ; 1 ) * 10^3 ) 

)

Note that this assumes non-negative numbers.

---

D J, try 0.0009.

I like it. Here's a less mathemagical method:

Let (

r = Round( number ; 3 ) + .0001 ;

Int( r ) & Left( Right( r ; 5 ) ; 4 )

)

Also assumes non-negative numbers, but could be modified pretty easily to deal with that.

mathemagical

LOL. If you prefer to do it with text functions, how about =

Let ( [

r = Round( number ; 3 ) ;

t = SerialIncrement ( "0000" ; r * 1000 )

] ;

Replace ( t ; Length ( t ) - 2 ; 0 ; "." ) 

)

This, BTW, will work with negative numbers, too.

  • Author

Thanks all I am still working through each idea . The issue with the first one which I should have made clear was that this has a label command. I have attached a screenshot. Basically I would like the phrase 'Margin of safety:' to prefix each number and you can see form teh screen shot that when I add in the new text for 'margin of safety', the labelling prefix disappears. I have yet to try for 'margin of safety baby' etc

Thanks

Filemaker.bmp

  • Author

So how do I incorporate all of that below into my 'margin of safety' text. I am not a filemaker pro like you lot!

Let ( [

r = Round( number ; 3 ) ;

t = SerialIncrement ( "0000" ; r * 1000 )

] ;

Replace ( t ; Length ( t ) - 2 ; 0 ; "." )

)

  • Author

Genius. That worked!!! Phew

Let([

start = Cosmet2010::Margin of Safety [zz__kf__Cosmet2009RepNum] ;

integer = Int ( start ) ;

decimal = start - integer ;

decimal1 = Substitute ( decimal ; "." ; "") ;

decimal2 = Left ( decimal1 & "000" ; 3 ) ;

result = "Margin of Safety Adult 60kg: " & integer & "." & decimal2

];

result

And how about something simple?

TextMerge.zip

---

BTW, in case you missed my earlier remark: if you do not round the number first, your result will be inaccurate in 50% of the cases on average.

  • Author

Thanks I like that one and stored that for future use. no doubt I can find a use for it

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.