Luis Calderon 0 Posted January 2, 2017 Hello all, I have a space symbol that calculates my occupant load. Is there a way to get the formula in the symbol to round up to a whole integer? This way I do not need to input the integer I want. Also is there a way for the area to have a thousands separator as well? See my attached screen shot. Thank you for your help! Quote Share this post Link to post
michaelk 466 Posted January 3, 2017 By space symbol do you mean a space label? Or have you found a way to build a symbol that links to the space record format? (If you have, 'fess up and tell us how!) I know I wrote a script that does something very similar to this in a space label before the forum hosting switch, so that file is gone. It basically calculated a number, rounded it off, and wrote it to one of the user fields. You just need to build a label using that user field. I did a quick search of this computer, but I don't see it. If I can find it, I'll post it again here. mk Quote Share this post Link to post
Luis Calderon 0 Posted January 3, 2017 Yes I meant space label. Yes if you find it please share. Thank you MK for your help! Quote Share this post Link to post
mgries 61 Posted July 25, 2017 On 1/2/2017 at 6:30 PM, michaelk said: I know I wrote a script that does something very similar to this in a space label before the forum hosting switch, so that file is gone. It basically calculated a number, rounded it off, and wrote it to one of the user fields. You just need to build a label using that user field. I did a quick search of this computer, but I don't see it. If I can find it, I'll post it again here. Hi mk, I'm in need of this exact script! I use a space label and calculate the occupant load using the formula field, but I'm stuck displaying the result using the decimal precision set for the entire document. Please share if you can find this! Thanks, Matt Quote Share this post Link to post
michaelk 466 Posted July 26, 2017 Found it! Here's how it works. Change the value in column F, then double click the script in the floating script palette. It occurs to me that this could probably be done with a script imbedded in a worksheet cell. But this works. mk Space Occ per Sq Ft.vwx 2 1 Quote Share this post Link to post
Chad Hamilton HAarchs 28 Posted July 29, 2017 You're looking for something like the CEILING function in Excel - I don't think this exists in VW, but the logical equivalent using available functions would be to compare the orginal number to it's integer (VW integer function rounds down to the nearest integer) - if the original number minus the integer is greater than the original number, then add 1 to the integer. The worksheet formula would be = IF (A-Int(A)>A,Int(A)+1,Int(A)) where A is the original number you want to round up to the nearest integer. Depending on your judgment, you could also use = IF (A-Int(A)>(A+0.01),Int(A)+1,Int(A)) where 0.01 added to A would eliminate adding one whole occupant where the fractional number was very small. 2 Quote Share this post Link to post
Chad Hamilton HAarchs 28 Posted July 30, 2017 In order to calculate the occupant load from the data in the Space Object, create a Space report. Figure out which VW fields or user fields you are going to use to enter the room function and occupant load factor - International Building Code calls it Function of Space and Occupant Load Factor (Table 1004.1.2) Enter the proper occupant load factor - VW is entering this data as a text string, so you need to convert it to a number using the Value function in the worksheet. In the database header, create a function something like Number of Occupants = ('Space'.'Area')/Value(Occupant_Load_Factor). Insert the cell number or field name with the occupant load factor. Then in the next column, use the rounding up formula = IF (A-Int(A)>(A+0.01),Int(A)+1,Int(A)) to round up the value of Number of Occupants the next higher integer. See the example file below. In your report, hide the Number of Occupants column, with the fractional number of occupants, and show the rounded-up column. Space_Label.vwx Quote Share this post Link to post
Ian M. 5 Posted August 22, 2018 On 7/29/2017 at 7:38 PM, Chad Hamilton HAarchs said: Space_Label.vwx @Chad Hamilton HAarchs What version is your attached file, please? (It won't open for me, but I'm back in 2013) Quote Share this post Link to post
Ian M. 5 Posted August 22, 2018 On 7/29/2017 at 7:38 PM, Chad Hamilton HAarchs said: IF (A-Int(A)>(A+0.01),Int(A)+1,Int(A)) shouldn't the formula be IF(A-INT(A)>0.01,INT(A)+1,INT(A)? Assuming you want any value .01 greater than the integer to be rounded up? Quote Share this post Link to post
Chad Hamilton HAarchs 28 Posted August 24, 2018 (edited) On 8/22/2018 at 4:36 PM, Ian M. said: @Chad Hamilton HAarchs What version is your attached file, please? (It won't open for me, but I'm back in 2013) From the date of the post, I'm pretty sure this is a VW 2017 file - we tend to stay up to date. Here is a copy of the file exported to VW 2013. But you should upgrade, the enhancements are worth it. Space_Label_v2013.vwx Edited August 24, 2018 by Chad Hamilton HAarchs add file. Quote Share this post Link to post
Chad Hamilton HAarchs 28 Posted August 24, 2018 On 8/22/2018 at 4:46 PM, Ian M. said: shouldn't the formula be IF(A-INT(A)>0.01,INT(A)+1,INT(A)? Assuming you want any value .01 greater than the integer to be rounded up? Yes, you are right - here is the formula pasted from the file - "I3" would be "A" from the written example. =IF(I3-INT(I3)>=0.01, (INT(I3)+1), INT(I3)) Quote Share this post Link to post