Skip 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.

exporting Number as Text with decimal and zeros

Featured Replies

I'm writing out some values to a text file in a FileMaker script, I would like the Number fields to be formatted like I have in my layout, where there is a decimal point a fixed number of digits following it.

Is there a function that takes a number and makes it as text with this kind of formatting?

Hi wplate:

There are ways to format Numbers for exporting (calculations, custom functions), but you may not have to go that far.

In FM8, the Export Records dialog box (menu or script step) has an option to Apply current layout's data formatting to exported data. So, if you can run your export from the formatted layout, that might be all you need! Or, create a layout dedicated for Exporting, where all of the Export's fields are formatted just the way you like.

Let us know how it turns out. If that doesn't do the trick, what type of Number formatting do you need ... monetary or something else?

P.S. Hear it's flooding in that neck of the woods. You and yours all right, I pray.

  • Author

Flooding? Yes and it is incredible. Thankfully we're all ok.

I'm afraid the suggestion to use export records won't help me. My scripts are populating a couple of fields that are used as the body of an email to be sent out via AppleScript and Entourage.

This morning I had the thought that I could run this calculation in my script...

"Amount = $" &

If (

Left ( Right ( ( NUMBER * -1) ; 3 ) ; 1 ) = "." ;

NUMBER ;

NUMBER & ".00" )

...I added this into my script and it seems to work since a number is either going to have a decimal point and "cents" or it is going to be a whole number with no decimal. So if the third character from the right isn't a decimal point, I need to add the ".00". BTW, I'm assured that if there IS a decimal point in my number, there will only be two digits to the right of it.

Is there a better way to do this?

Seems a bit convoluted. And what if the number is 5.10?

See if this suits you better.

Hey wplate!

Glad you folks are okay. Don't risk low-water crossings ... "Turn Around. Don't Drown!"

I can't say if there's a "better" way, but the link below will lead to some other ways.

Lee Smith contributed a helpful post back in the Spring in this "Convert number to text for currency" thread. Hopefully you'll find it useful.

Sorry the Export Records approach can't be applied in this case. I felt lucky for a bit. :sorrysign:

  • Author

Right, 5.10 could come out as 5.1 and that wouldn't be good.

I'll try to make sense of the suggestions on the page you suggested. Thank you!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.