Skip to main content
Participant
November 10, 2020
Answered

Round Up Measurement Calculation

  • November 10, 2020
  • 2 replies
  • 1417 views

Hi,

I'd like to have the attached PDF calculate the required materials needed based on the square footage of a space.

 

In the example provided,

Area Totals (ft) shown are 11ft length x 12ft width.

The Total Square Feet (length x width) calculation is 125.33.

Total Square Feet's calculation is using 10.666667 x 11.75 = 125.33.

 

What script can I use to ensure Total Square Feet is calculated using round numbers from Area Totals (ft),  which are Length 11 ft and Width 12 ft in my example?

 

Thank you in advance.

This topic has been closed for replies.
Correct answer ls_rbls

Why would you round up so much? Shouldn't you be accurate?


I agree with Asim, but I think in this case, when you're converting "feet to inches to inches" in the formula that is currently used the accurate result is : 15.833333333333334. 

 

Since it is a project estimator is OK to make this rounding up. If it was a construction project where you are actually buying panels of wood to build a wall in a house, then yes; it is extremely important to punch in the exact measurements, so that you don't get overcharged, and so thaty you also don't run short on materials if your contractor cuts everything with the incorrect measurements.

2 replies

ls_rbls
Community Expert
Community Expert
November 10, 2020

In the "TotalSquareFeet" field use a custom calcuation script like this:

 

event.value = Math.round(Math.ceil(this.getField("AreaTotalsftlength1").value) * Math.ceil(this.getField("AreaTotalsftwidth").value) );

 

If you do it like this it will total in a consistent manner as shown by any square footage  online calculator:

 

You should get this result in your PDF:

 

 

Participant
November 11, 2020

Thank you very much for this script. It worked perfectly!

Participant
November 11, 2020

ls_rbls

 

How can I get the Area Totals (ft) to always round up? Is there a script that will make this work?

 

In the attached image, the Area Totals (ft/in) are 15 ft 10 inches for Length and 12 ft 5 inches for Width.

The Area Totals (ft) are shown as 16 ft Length and 12 ft Width (however if you click it shows 15.833 Length and 12.41667 Width).

I am trying to get the Area Totals (ft) shown to display 16 ft Length and 13 ft Width so that the calculation shown for Total Square Feet will appear accurate. Total Square Feet is 208 ft. which is (16x13).

 

Any help would be appreciated.

try67
Community Expert
Community Expert
November 10, 2020

Use this code:

var v1 = Number(this.getField("AreaTotalsftlength1").valueAsString);
var v2 = Number(this.getField("AreaTotalsftwidth").valueAsString);
event.value = (v1*v2).toFixed(2);