News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Have a Question About Rounding in Inputs/Outputs

Started by Reddog54, March 27, 2014, 01:49:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Reddog54

I had a similar issue with this the other day drawing a rounded box and Prl helped with that and I changed my Precision under Coordinate Systems under Options to 15 and fixed that problem.  My problem is that when I prompt for input to a macro and then print those inputs back out to the screen they are rounded to 3 decimal places.  I don't know if the display is rounding or if the actual input is being rounded.  Either way I need to know how I can adjust so I can input and verify that I have input at least 5 decimal places, or do I need to initialize the input fields first? and if so how? Right now if I enter 3/32 (.09375) it will show as .094.  Not sure which number it is actually using.

I was using sysex(xx) for inputs but changed it to W,L and T for Width, Length and Thickness as I don't need to store the data after the macro runs, but it didn't matter either way, it still rounded to 3 decimal places.  Adding screen shots of my input and a display of what it shows I entered.

I will post syntax if you need me to but I am just prompting for inputs and assigning their values to W,L & T and going from there.  I am using DCAD v23.

Any help, tips, comments would be appreciated.

Steve

prl

Steve, you're looking for the precision statement.  From the macros17.hlp, http://forum.designcad.com/index.php?topic=5

I've copied the example:

x = 44.123456789

Precision 0

Print x * 2   ' prints "88"

Precision 4
Print x   ' prints "44.1235"

Precision 0
x = 2
a$ = x
f$ = "file" + a$ + ".dat"
Print f$   ' prints "file2.dat"


Precision 3
x = 44.123456789
x$ = x
>Text
{
     <Text [x$]
}

     ' Text drawn is "44.123"
     ' The string assignment was done using the current PRECISION.


Reddog54

Thanks again Prl.  I had just figured out the input numbers were correct but when I printed it was when it was getting rounded.  Now I know how to correct that.  Much appreciated :)