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.

result calculated from radio buttons

Featured Replies

I would like to know how to write a script or calculation that will enter the tax amount depending on either of two radio buttons. i.e. I have two radio buttons - 'T0' and 'T1'. If T0 is selected then I want the tax amount to be 0, otherwise I want the result to be the net amount x 1.175.

Thanks for the help

Lyndon

Here you go. Quick and dirty. You need to make it yours.

Tests2.zip

I made the attach example up for someone else, but apparently not for the Forum, at least I couldn't find it. Anyway, it isn't exactly like you described, but should help you figure out what you want.

Lee

SalesRetail_Whole_Sale.fp7.zip

Answering the original question for future reference though, you could use either an if or a case statement to achieve what you want. Just pointing this out to you because these may in mamy cases be the basis for many of your calculations.

The format would be:

If(test , result if returns true, result if test returns false)

Case(

test, result if true,

test, result if true,

test, result if true,

more tests, more results if true,

default result if none return true

)

So in this case for example it would be If(taxfield = "T0" , 0 , netamount * 1.175 )

God comma's put me off...

~Genx

Tax rates change, so you shouldn't hard-code the rate into a calculation. It should be kept in a global field, or in a preferences/settings file, and looked up or auto-entered with the creation of a new record.

I would also calculate the TaxAmount separately - in case someone wants to figure how much tax they paid in total. The calc for this would be:

Round ( Amount * TaxRate * ApplyTax , 2 )

where ApplyTax is a Number field with either 0 (exempt) or 1 (taxed). The final sum to pay is Amount + TaxAmount.

Just to clarify, the TaxRate in this example would be 0.175, not 1.175.

I thought it was bad practice to keep values that will change in a global field?

~Genx

User-specific values - certainly. Solution-wide values, that only change occassionally - not necessarily.

I agree that hard coding is really not the way to go, however, I just gave Llyndonium what he/she asked for. You could simply enter the tax rate or use a VL and have one button with the simple calc comment has offered, or no button at all, and it solves the problem and gives a lot more flexibility.

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.