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

I have two fields. The first contains either a "+" or "-" sign, selected from a value list. The second contains a positive number with two decimal places. If the user selects "-" in the first field and enters 2.25 in the second field, then I would like a calculation to return "-2.25" as a rational number that I could use in a separate calculation. Conversely, If the user selects "+" in the first field and enters 2.25 in the second field, then I would like the calculation to return "+2.25" (or just "2.25").

Another problem that I've come across is that if I put a "-" sign in a value list, Filemaker 6 returns a separator instead of a minus sign. I've resorted to an "em dash" in the value list, but I'm not sure if it will be interpreted as a minus sign in subsequent calculations.

Thanks for your suggestions!

Jason

  • Author

Here's a sample file which illustrates the problem.

Calc.fp5.zip

Hi Jason,

Use a minus sign followed by a space.

Ernst

It would be easier to use "pos"/"neg" than "+"/"-".

See attachment for possible solution.

Calc.zip

Hi Jason,

I guess there are a few different ways you could approach this.

Attached is yet another alternative that you might like to consider. wink.gif

Calc.zip

  • Author

It turns out this problem is more tricky than I first described it. This is for eyeglass prescriptions. I now realize that I should not have a separate plus/minus field, as I mistakenly indicated earlier.

The various eyeglass power measurements are recorded in number fields. As expected, negative numbers have a minus sign. Convention requires that positive numbers have a plus sign in front of them. No problem until I add two of these positive numbers together (as when calculating the strength of reading glasses); then I get a positive number without a positive sign. It turns out opticians can't make heads or tails of this result.

So I need to add together two positive numbers which have a plus sign in front of them, and have the result contain a plus sign. (Alternatively, if the patient is myopic, and the sum is negative, then the result should have a minus sign -- but Filemaker does this).

Put more simply, if an arithmetic sum is positive, the result should have plus sign. Also, the result must have two places after the decimal point.

Seems simple enough, but I can't figure it out.

Thanks for your help. I've posted an attachment to illustrate this problem.

Jason

Trial.fp5.zip

The calculation's result must be of type "text" to make it work:

Case((a+:>0, "+" &( a+:, (a+:

For setting number of decimals see this thread

Dj

  • Author

Thanks djgogi,

Your calc eliminates the need for a script. I looked at the thread that you recommended and it left my head spinning. I really could use some help on this one. I've update my example problem, using your calc, and expanded the value lists to contain all the realistic numbers that this calc would use.

Thanks again,

Jason

Trial2.fp5.zip

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.