Author |
Topic |
|
andrewdsto
Australia
Posts |
Posted - 12/02/2010 : 01:41:54 AM
|
Origin Ver. 8.5 pro and Service Release 1 (Select Help-->About Origin): Operating System:windows xp pro, 64 bit
Hello, I have an issue with they system.numeric setting I used to be able (version 8.0) to simply set the system.numeric.numdecplaces to a value and the program would round of all my numbers to the required level. This does not seem to be happening in version 8.5.
for example, if i run the following code:
xval=12345.6789;
SYSTEM.NUMERIC.NUMDECDIGITS=7; type "xval= $(xval)"; xval=; type; ///
SYSTEM.NUMERIC.NUMDECDIGITS=3; type "xval= $(xval)"; xval=; type; ///
System.sigDigitsL=; System.sigDigitsU=; type; /// type "xval= $(xval)"; xval=; SYSTEM.NUMERIC.NUMDECDIGITS=;
I return the following: xval= 12345.6789 xval=12345.6789
xval= 12345.6789 xval=12345.6789
System.sigDigitsL=-3 System.sigDigitsU=3
xval= 12345.6789 xval=12345.6789 SYSTEM.NUMERIC.NUMDECDIGITS=3
In version 8.0, this would return the correct number of decimals ie: 3 decimal places, I can set this in the options also, and cahnge it to decimal places or significant digits, but there is no change in the numerical output precision.
However, If I use the following
xval=123.456789; type "xval= $(xval)"; xval=;
type; /// xval=; type "xval= $(xval, %3.3f)"; type "xval= $(xval, %3d)"; type "xval= $(xval, *6)"; type "xval= $(xval, .3)";
it returns:
xval= 123.456789 xval=123.456789
xval=123.456789 xval= 123.457 xval= 123 xval= 123.457 xval= 123.457
which is the correct decimal places or significant digits
I would like to know if this is a bug or am i using this wrong, as indicated it would work in V8.0 by setting the SYSTEM.NUMERIC.NUMDECDIGITS to the required precision. Note that these the changes in the system variables is reflected in the options dialog box after the code is ran. So it is seeing these values it just is not applying them.
I can use the 'C' formatting method as indicated in the second lot of code above but it requires a rewrite of my existing prorams, when all I had to do before was set the system variable.
thanks Andrew
|
|
easwar
USA
1964 Posts |
Posted - 12/06/2010 : 11:09:58 AM
|
Hi Andrew,,
Yes this appears to have stopped working since version 8.1 Thanks for pointing this out, we will look into this.
Easwar OriginLab
|
|
|
cpyang
USA
1406 Posts |
Posted - 12/07/2010 : 01:16:55 AM
|
hi Andrew,
If you care about the output display, you better off using $(x, .3) etc to control precisely from your code.
We decided to use @SD to control default $(x) substituion and not use the global setting from System.Numeric. (Tools Options) as that setting controls the worksheet data display.
We will add @SDD in next version to provide global control for $(x) to use fixed decial digits instead of significant digits.
CP
|
|
|
andrewdsto
Australia
Posts |
Posted - 12/19/2010 : 9:47:54 PM
|
Thanks Guys |
|
|
|
Topic |
|
|
|