Author Topic: Table value precision  (Read 3433 times)

0 Members and 1 Guest are viewing this topic.

DanB

  • Bull Frog
  • Posts: 367
Table value precision
« 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?

DanB

  • Bull Frog
  • Posts: 367
Re: Table value precision
« Reply #1 on: October 31, 2018, 11:39:19 AM »
Still hoping someone might have a better suggestion but for now this is working:

Code: [Select]
=(trunc(abs (trunc (J29*0.3) -(J29*0.3))*100))/100+trunc (J29*0.3)

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Table value precision
« Reply #2 on: October 31, 2018, 12:48:53 PM »
this?
Be your Best


Michael Farrell
http://primeservicesglobal.com/

DanB

  • Bull Frog
  • Posts: 367
Re: Table value precision
« Reply #3 on: October 31, 2018, 01:55:24 PM »
That setting only applies to what is displayed in the table. My problem is I am using that cell's value for additional computations.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Table value precision
« Reply #4 on: October 31, 2018, 03:03:13 PM »
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
Be your Best


Michael Farrell
http://primeservicesglobal.com/

DanB

  • Bull Frog
  • Posts: 367
Re: Table value precision
« Reply #5 on: November 01, 2018, 12:12:52 PM »
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.

ChrisCarlson

  • Guest
Re: Table value precision
« Reply #6 on: November 01, 2018, 02:49:16 PM »
AutoCAD has a pretty rudimentary table formula backend. What about pushing this this to excel and simply link to an excel file?

DanB

  • Bull Frog
  • Posts: 367
Re: Table value precision
« Reply #7 on: November 01, 2018, 04:13:44 PM »
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.

ChrisCarlson

  • Guest
Re: Table value precision
« Reply #8 on: November 02, 2018, 08:50:43 AM »
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.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Table value precision
« Reply #9 on: November 02, 2018, 10:02:02 AM »
Or, just use Excel entirely instead of trying to use AutoCAD as a spreadsheet.  Kind of like using Excel as a drawing program...
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Table value precision
« Reply #10 on: November 02, 2018, 11:13:12 AM »
Or, just use Excel entirely instead of trying to use AutoCAD as a spreadsheet.  Kind of like using Excel as a drawing program...
Agreed.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC