Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Round Up Measurement Calculation

Community Beginner ,
Nov 10, 2020 Nov 10, 2020

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.

TOPICS
How to
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
3 ACCEPTED SOLUTIONS
Community Expert ,
Nov 10, 2020 Nov 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:

 

squarefoot.png

 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2020 Nov 11, 2020

For those two fields, instead of using "Number" to format them, add the following custom format script in both of them:

 

event.value = Math.ceil(event.target.value);

 

Here's a copy of your original with the scripts added to it: Project Estimator 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2020 Nov 11, 2020

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.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 10, 2020 Nov 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);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 10, 2020 Nov 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:

 

squarefoot.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 10, 2020 Nov 10, 2020

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 11, 2020 Nov 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.Screen Shot 2020-11-11 at 10.59.44 AM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 11, 2020 Nov 11, 2020

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2020 Nov 11, 2020

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2020 Nov 11, 2020

For those two fields, instead of using "Number" to format them, add the following custom format script in both of them:

 

event.value = Math.ceil(event.target.value);

 

Here's a copy of your original with the scripts added to it: Project Estimator 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 12, 2020 Nov 12, 2020
LATEST

Thank you!! 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines