Hi there,
I have field varchar
The data is 20, 30, 40-50
I have a formula if it is 20 or 30 it's fine but with 40-50
did not rounded
// To calculate the quantity of stickers to be printed on the packing slip.
// Stickers are printed in multiples of 20. Checks value in No of Attendees
// field on Name Events screen - if blank or less than 20, quantity is 20.
// Otherwise, the value is rounded up or down to the nearest 20.
// (e.g. 30 is rounded down to 20 and 31 is rounded up to 40).
// Declare variables
Local numberVar NumGuests;
Local numberVar NumStickers := 0;
Local numberVar NumRemainder := 0;
// Initialise NumGuests
IF (NOT(ISNUMERIC({Name_Events.STATUS_EVENT})) OR
ToNumber({Name_Events.STATUS_EVENT}) <= 20) THEN
NumGuests := 20
ELSE
NumGuests := ToNumber({Name_Events.STATUS_EVENT});
//IF NumGuests <= 20 THEN
//NumGuests := 20;
IF NumGuests > 20 THEN
NumRemainder := Remainder(NumGuests, 20);
IF NumRemainder <= 10 THEN
NumGuests := NumGuests - NumRemainder
ELSE
NumGuests := NumGuests - NumRemainder + 20;
NumStickers := NumGuests;
thank you
I have field varchar
The data is 20, 30, 40-50
I have a formula if it is 20 or 30 it's fine but with 40-50
did not rounded
// To calculate the quantity of stickers to be printed on the packing slip.
// Stickers are printed in multiples of 20. Checks value in No of Attendees
// field on Name Events screen - if blank or less than 20, quantity is 20.
// Otherwise, the value is rounded up or down to the nearest 20.
// (e.g. 30 is rounded down to 20 and 31 is rounded up to 40).
// Declare variables
Local numberVar NumGuests;
Local numberVar NumStickers := 0;
Local numberVar NumRemainder := 0;
// Initialise NumGuests
IF (NOT(ISNUMERIC({Name_Events.STATUS_EVENT})) OR
ToNumber({Name_Events.STATUS_EVENT}) <= 20) THEN
NumGuests := 20
ELSE
NumGuests := ToNumber({Name_Events.STATUS_EVENT});
//IF NumGuests <= 20 THEN
//NumGuests := 20;
IF NumGuests > 20 THEN
NumRemainder := Remainder(NumGuests, 20);
IF NumRemainder <= 10 THEN
NumGuests := NumGuests - NumRemainder
ELSE
NumGuests := NumGuests - NumRemainder + 20;
NumStickers := NumGuests;
thank you