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.

Split a number but the result should be always

Featured Replies

Is there a way to do this? The difference should be as close as possible. I use even number because the number are by pairs. 2 4 6 8 10

Example

18 =  10 and 8

20 =  10 and 10

22 = 12 and 10

36 = 18 and 14

 

 

 

5 minutes ago, chadski021 said:

36 = 18 and 14

Why?

  • Author

because i cant split them 16 and 16 there both equal. Also if use 17 + 15 i will not work since the number are odd. So i move to 18 by 14.

 

I am afraid I don't follow your logic. You split 20 into 10 and 10; they're equal and even. Why can't you split 36 into 18 and 18? They are also equal and even. OTOH, 18 + 14 = 32, not 36 - so this makes no sense to me at all.

 

  • Author
14 minutes ago, comment said:

I am afraid I don't follow your logic. You split 20 into 10 and 10; they're equal and even. Why can't you split 36 into 18 and 18? They are also equal and even. OTOH, 18 + 14 = 32, not 36 - so this makes no sense to me at all.

 

Sorry the 20 = 10 + 10 is wrong it should be 12 + 8. Basically we have to split it 60% / 40% something like that. the difference should be as close as 1 to 2 pairs.

Edited by chadski021

29 minutes ago, chadski021 said:

something like that

I am afraid that's not a good enough description. You are asking how to do something, but we don't know exactly what that something is. Maybe you should start by explaining why this is needed.

 

ADDED:

Maybe something like this could work for you::

Let ( [
a = 2 * Ceiling ( number / 4 ) ;
b = 2 * Floor ( number / 4 ) 
] ;
If ( a = b ; List ( a + 2 ; b - 2 ) ; List ( a ; b ) )
)

This returns:

18 = 10 + 8;
20 = 12 + 8;
22 = 12 + 10;
36 = 20 + 16.

 

Edited by comment

  • Author
2 minutes ago, comment said:

I am afraid that's not a good enough description. You are asking how to do something, but we don't know exactly what that something is. Maybe you should start by explaining why this is needed.

 

Ok, I try my best to explain this. We have a database called shutter. Shutter is installed to window/door and has blades by pairs. ex 20 = 10 pairs. We have scenario that a sliding door has 2 panels. 50% 1 panel can slide and 50% 1 cannot slide. Basically we install the shutter always 50% by 50% if the middle window is open and lock reachable in the middle. But in this case 50% of slide cant be open, So i need to increase at 1 to 2 pairs of blade so its still able to lock it inside. attached is my sample idea

sample.png

Okay, then I think my suggestion above should work for you. If you like, you can split the calculation to two fields:

2 * Ceiling ( Number / 4 ) + 2 * not Mod ( Number ; 4 )

and:

2 * Floor ( Number / 4 ) - 2 * not Mod ( Number ; 4 )

 

  • Author

thanks @comment it works what a relief. Also What if the difference is 3 to 4 pairs?

Edited by chadski021

7 minutes ago, chadski021 said:

Also that if the difference is 3 to 4 pairs?

Sorry, not sure what you mean by that.

  • Author
16 minutes ago, comment said:

Sorry, not sure what you mean by that.

something like 

20 = 16 and 4

30 = 18 and 12

Wouldn't it be just a matter of adding/subtracting 2 to the results of the above?

  • Author
4 minutes ago, comment said:

Wouldn't it be just a matter of adding/subtracting 2 to the results of the above?

Got it thank you so much.

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.