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

 Thread Tools Search this Thread Display Modes
#1
March 11th, 2015, 08:56 AM
 dreimer Senior Contributor Join Date: Oct 2010 Location: Shakopee, MN Posts: 496
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.14.6 Acrobat DC FP Creator 12.0.1

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: Hamden, CT Posts: 266
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 12.0.3
Adobe Acrobat Pro 2021
macOS Big Sur 11.6.2
#3
March 11th, 2015, 09:06 AM
 dreimer Senior Contributor Join Date: Oct 2010 Location: Shakopee, MN Posts: 496
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.14.6 Acrobat DC FP Creator 12.0.1

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Welcome     Start Here!     MarcomCentral News Software-Related Talk     Documentation     Getting Started         Sample Jobs         Tips & Tricks         Digital Print Workflow     The JavaScript Library         Getting Started, Learning, Etc.         Formatting Text         Graphic Rules         Barcodes         Dates         Tables & Charts         XML Dialog Boxes     FusionPro® VDP Creator         Imposition     MarcomCentral®         FusionPro® Templates - Best Practices         Admin Tool - Questions and How Tos         Distribution - Formerly Dashboard         JobDirect® Plus         Web Services and Data Feeds         ExactTarget/Email Product Type     FusionPro® Links         Microsites     FusionPro® Expression™     FusionPro® VDP Producer (formerly FusionPro® Direct)     FusionPro® VDP Server (API) Off Topic     Customer Polls     Job Board (Moderated)     Reviews, Rants, and General Musings Support     Issues, Questions, Etc.     Digital Workflow Documents     Fonts

All times are GMT -7. The time now is 04:27 PM.

 Contact Us - marcom.com - Archive - Privacy Statement - Top