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.

Setting number precision as text

Featured Replies

I have a number field that I want to display as part of a calculated result in a text field. I want to the number to display as a decimal (ie 50.00). I have tried using SetPrecision( number_field ; 2 ) and Truncate( number_field ; 2 ). I have tried different combinations of GetAsText and GetAsNumber.

Here's one way I tried:

Let ( amount = SetPrecision ( numberField ; 2 ) ;

"Date: " date & "; Amount $:P " & amount )

No Luck. It seems like these ideas would work, but NO. Any help? Thank you.

Quillpro

If your number field raw data is entered as 50.00 than FileMaker in Version 8 will retain the format.

so, this:

"Date: " & Date & " Amount: " & Numberfield

should do it.

HTH

Lee

Edited by Guest

Hi

you can try this too:

Let([

i = If ( Int ( number ) = 0 ; 0 ; Int ( number ) ) ;

d = If ( Mod ( number ; Int ( number ) ) = 0 ;".00" ; Left ( Abs ( Mod ( number ; Int ( number ) ) ) & "00" ; 3 ) )

];

"Date: " date & "; Amount $:P " & i & d

)

Or simply:

Int ( numberField ) & "." & Right ( "00" & numberField * 100 ; 2 )

This is assuming numberField is pre-rounded to 2 decimal places and never negative.

I want to display "Date: " date & "; Amount $:P " & amount )
.

You may not need a calc at all. Might merge field work for you?

Date: <> Amount $: <>

You can then format the date and the amount as you wish by selecting the merge field, right-click and select number format (change to 2 decimals) or date format to specify your date display.

  • 3 weeks later...
  • Newbies

I am having a similar problem to QuillPro. I am manually summarising data using global fields and Get Summary function. The results are placed in one field. This field needs to be a text field as there is text in this field as well. As a result, all numbers are stripped back to form they were input. So "5,005.50" ends up as "5005.5" etc.. Is there any script that will maintain the 2 decimal places and the thousands separator? Merge fields will not work for me as there may be a number of results in each summary.

For non-negative amounts, pre-rounded to 2 decimal places, with a single thousands separator, you can use:

Case ( Div ( Amt ; 1000 ) ; Div ( Amt ; 1000 ) & "," )

&

Right ( Int ( Amt ) ; 3 )

& "." &

Right ( "00" & Amt * 100 ; 2 )

For more complex options, see here.

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.