MarcomCentral (PTI) and FusionPro User Communities Rounding Up
 Register FAQ Calendar Search Today's Posts Mark Forums Read

 Notices If you are not registered or logged in, you can view the forums but you cannot post to them. The latest version of FusionPro® VDP is 11.0.8 (Windows and Mac). Adobe Acrobat DC 2019, Adobe InDesign 2020, macOS 10.15 (Catalina), and Windows 10 are now supported! Please follow MarcomCentral on LinkedIn, Facebook, Instagram, and Twitter. We would love to hear from you and keep in touch! Check out the new FusionPro.com!

#1
March 11th, 2015, 08:56 AM
 dreimer Senior Contributor Join Date: Oct 2010 Location: Shakopee, MN Posts: 473
Rounding Up

I have some jobs that have differing quantities ordered. I can fit 1500 per box. I am trying to create a rule to determine how many cartons are needed for each order. So then my labels will say for example 1 of 1 or 1 of 2, etc.

I used this rule but am not sure how to have no decimal places and round to the nearest whole number.

Code:
`return Round((Field("Total Qty")/1500),0)`
So for example one record will have 500 for the quantity but the rule returns .3 and will in turn return 0 but I want it to return 1. For order for 1000 it will return 1 since it is .6 and rounds up.

Question: Is there syntax to round up for any fraction of a whole number?

TIA
__________________
Don Reimer - JavaScript Novice

MAC OS 10.13.6 Acrobat DC FP Creator 10.1.11
Windows 7 Acrobat X 10.1.4 FP Creator 9.3.9

Last edited by dreimer; March 11th, 2015 at 08:59 AM..
#2
March 11th, 2015, 09:02 AM
 David Miller Senior Contributor Join Date: Oct 2008 Location: Wallingford, CT Posts: 263
Re: Rounding Up

Suggest looking at this post here. It might help.

Math.ceil rounds up, Math.floor rounds down and Math.round rounds to the nearest integer.
__________________
David Miller
FusionPro VDP Creator 10.0.26
Suitcase Fusion 20.0.0 (7653)
macOS High Sierra 10.13.6
#3
March 11th, 2015, 09:06 AM
 dreimer Senior Contributor Join Date: Oct 2010 Location: Shakopee, MN Posts: 473
Re: Rounding Up

Sorry when I searched the forums I saw the title rounding to the nearest 5 so I didn't think it applied. Lesson learned, look at the thread anyway.

Thanks this works perfectly.
__________________
Don Reimer - JavaScript Novice

MAC OS 10.13.6 Acrobat DC FP Creator 10.1.11
Windows 7 Acrobat X 10.1.4 FP Creator 9.3.9