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 am stuck
I need a calculation
Odd number -1
if even number - 2

let(
[

_mod = mod( <your number field> ; 2 )


];

if(

_mod = 0 ; 2 ;

1

)

 

)

 

 

 

  • Author

thanks so much

Sorry it did not work

 

Example if I have the number 7 I need it to return 6

If I have the number 8 I need it to return 6

  • Author

I am not getting this to work

my number field input is 7

I am getting a return of 1

I need it to be 6 ( as above )

48 minutes ago, indy4300 said:

I need a calculation
Odd number -1
if even number - 2

That's not very clear, Please spend more time formulating your request, so we don't have to guess.

Based on:

18 minutes ago, indy4300 said:

my number field input is 7

I am getting a return of 1

I need it to be 6 ( as above )

I am guessing you want to do:

Number - Choose ( Mod ( Number ; 2 ) ; 2 ; 1 )

Or, if you prefer:

Number - 2 + Mod ( Number ; 2 )

Or even:

2 * Div ( Number - 1 ; 2 )

 

Edited by comment

  • Author

I am not sure how I can explain this any better Please explian what you are guessing at I just dont know how to explain it any better

Odd number -1
if even number - 2

Calculated Input number 7 I need it to return 6

Calculated Input number 8 I need it to return 6

 

Number - Choose ( Mod ( Number ; 2 ) ; 2 ; 1 )
calculated field input Number is 7 - Choose ( Mod ( calculated field input Number is 7  ; 2 ) ; 2 ; 1 )
Return number is 4

Number - 2 +  Mod ( Number ; 2 )
calculated field input Number is 7  - 2 +  Mod ( calculated field input Number is 7  ; 2 )
Return number is 4


 

 

46 minutes ago, indy4300 said:

I am not sure how I can explain this any better

That's actually very simple: (a) use full sentences; (b) explain the rule first, then give some examples. When explaining the rule, provide step-by step instructions how would one do the calculation manually. For example: if the given number is odd, subtract 2 from the given number; if it's even, subtract 1 (and then I would ask what if the given number is not an integer).

 

46 minutes ago, indy4300 said:

Number - Choose ( Mod ( Number ; 2 ) ; 2 ; 1 )
calculated field input Number is 7 - Choose ( Mod ( calculated field input Number is 7  ; 2 ) ; 2 ; 1 )
Return number is 4

Number - 2 +  Mod ( Number ; 2 )
calculated field input Number is 7  - 2 +  Mod ( calculated field input Number is 7  ; 2 )
Return number is 4

When Number is 7, both:

Number - Choose ( Mod ( Number ; 2 ) ; 2 ; 1 )

and:

Number - 2 +  Mod ( Number ; 2 )

return 6, not 4 as you claim (that is if I understand you correctly: I am not sure what exactly you mean by "calculated field input Number").

 

Edited by comment

comment gave the short version on how to post a good topic, Please read this for the full one Anatomy of a Good Topic

BTW, the three calculations by comment provided the correct answer to your question.

  • Author

Thanks so much for your kindness and understanding :)
I did get it to work
I will provide more information in a better formatted way
Thanks again

I have read Anatomy of a Good Topic  and bookmark it thank you

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.