Integer division and reminder of division for fields formulas.

Integer division and reminder of division for fields formulas.

Anonymous
Not applicable
915 Views
2 Replies
Message 1 of 3

Integer division and reminder of division for fields formulas.

Anonymous
Not applicable

Hello.

As you may know it is possible to use some calculation results in the text fields.

timchishinevgeniy_0-1604259183203.png

For example here I divide 5 by 2 and get 2.5. 

Do somebody know if it is possible to get integer division result and also the reminder of the division?

Fox example:

Integer division: 5 // 2 = 2

Reminder of division: 5 % 2 = 1

Are there some operators or functions for that?

0 Likes
Accepted solutions (1)
916 Views
2 Replies
Replies (2)
Message 2 of 3

cadffm
Consultant
Consultant
Accepted solution

If REM isn't a valid function, you can use TRUNC

 

2.5 - trunc 2.5 = 0.5

 

EDIT:

In your sample case

5-trunc(5/2)*2 = 1

 

or

17-trunc(17/2)*2 = 1
11-trunc(11/3)*3 = 2

 

Or?

 

Sebastian

Message 3 of 3

Anonymous
Not applicable

"trunc" is perfect, thanks!

0 Likes