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,

I'm trying to format a number into a currency within a text calculation field.

For example,

"Government Fee : " & GovProcessingFee

would result to "Government Fee : 75"

I wish to obtain "Government Fee : $75.00"

Isn't there an easy way to do this ?

I COULD do the whole calculation using a case, patterncount and position but it seems there SHOULD be an easier way to do this...

Thanks

You could combine the fields on a layout using a text merge of two fields instead of creating a calculation field. If you select the text in layout mode, you can assign a number format to it. The only done side is if you have two merged number fields in the text, you only get to select one number format per text object.

In Layout Mode:

"Government Fee : <<GovProcessingFee>>"

(place this on the layout without the quotes, of course)

-bd

  • Author

That would work but the thing is this is all part of a bigger calculation which tests if some fields are empty before displaying them. So I achieved what I was wanting to do like this for fields that have a value for sure :

"Government Fees : " &

"$" & Case(

PatternCount( NumToText(Round( GovProcessingFee, 2)), ".") = 0,

NumToText(Round( GovProcessingFee, 2)) & ".00",

PatternCount( Right( NumToText( Round( GovProcessingFee, 2)), 2), ".") = 1,

NumToText(Round( GovProcessingFee, 2)) & "0" ,

NumToText(Round( GovProcessingFee, 2)))

I just think that there should be a FormatNumToText function or something. It would make my long calculation much easier to read and debug.

Thanks for your help.

If anyone figures out a better way to do this, please let me know.

See my answer to dschaal's post in this same forum area on "Calculation needed to format $ amount". My answer will give you $, commas and handle +/- numbers up to 12 digits (so that shouldn't be a limit unless you own Microsoft). My answer also contained another novel way of achieveing this using the "Copy Record" script command.

Either way, you end up with a text field which contains the text expression of your amount, then just concatenate this into your final result.

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.