Skip to Content
0

BPC 10.0 NW script logic for round up

Dec 11, 2016 at 08:23 PM

160

avatar image

Our headcount numbers could be 0.7, 2.3, -0.2 etc. We would like to round up the numbers to get the seat count. In the above examples it should be 1, 3, -1. Wondering what is the script logic to get round up function.

*XDIM_MEMBERSET HC_ACCOUNT = HEADCOUNT_SAW

*WHEN HC_ACCOUNT
*IS HEADCOUNT_SAW
*REC(EXPRESSION = %VALUE%,HC_ACCOUNT = "SEATCOUNT_SAW")
*ENDWHEN

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Vadim Kalinin Dec 12, 2016 at 07:25 AM
0

For your particular case the following can be used:

*REC(EXPRESSION=(%VALUE%>0) ? Math.ceil(%VALUE%) : Math.floor(%VALUE%),HC_ACCOUNT = "SEATCOUNT_SAW")

Show 1 Share
10 |10000 characters needed characters left characters exceeded

That worked. Thanks Vadim.

0
Vadim Kalinin Dec 11, 2016 at 09:20 PM
0
Share
10 |10000 characters needed characters left characters exceeded