TheSwamp
CAD Forums => CAD General => Topic started by: DanB on October 31, 2018, 10:45:26 AM
-
I need to have a table cell value truncated to 2 decimal places. The current cell is "=(J29*0.3)" and returns the value of 23.83462 which I can properly display as 23.84 but causes issues later when further applied to another cell. What I would like to have is the cell value be "23.84", any suggestions?
-
Still hoping someone might have a better suggestion but for now this is working:
=(trunc(abs (trunc (J29*0.3) -(J29*0.3))*100))/100+trunc (J29*0.3)
-
this?
-
That setting only applies to what is displayed in the table. My problem is I am using that cell's value for additional computations.
-
so your data that is entered needs to accurate enough to not introduce errors later.....
as such it would appear the underlying issue is the accuracy of the data entered (or what it is being extracted from) not the format of the cell....
the solution is to get the input data correct....from my perspective
-
Nothing wrong with the level of accuracy of the data. It just so happens when taking several steps involving a percentage of certain cells then adding or subtracting various results, they will round one way or the other and appear not to total that which is displayed.
-
AutoCAD has a pretty rudimentary table formula backend. What about pushing this this to excel and simply link to an excel file?
-
Linking to excel is a possibility. It's frustrating though that there is a "trunc" function available, however, it is defined as truncating to an integer. Simply allowing the user to truncate a value to any given decimal precision would be beneficial, at least to me at the moment.
-
What exactly is the table doing? Another option could be taking all of the formulas out of the table and calculate the cell values through lisp.
Take a gander here (https://www.cadtutor.net/forum/topic/62165-searching-lisp-about-adding-texts-to-table/?do=findComment&comment=512950).
-
Or, just use Excel entirely instead of trying to use AutoCAD as a spreadsheet. Kind of like using Excel as a drawing program...
-
Or, just use Excel entirely instead of trying to use AutoCAD as a spreadsheet. Kind of like using Excel as a drawing program...
Agreed.