Jump to content

This topic is 7793 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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

This topic is 7793 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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