Value with two decimal marks

Use this forum to post Vensim related questions.
Post Reply
apix
Senior Member
Posts: 64
Joined: Wed Mar 16, 2011 3:31 pm

Value with two decimal marks

Post by apix »

Hi,

I got a strange number (1..000) for the result of a variable.
The graph gets correctly drawn, the other values of the variable look normal, but for a combination of subscript and a time step there are two decimal marks.
Looking the previous and the next values, it doesn't seems that a decimal mark took the place of a number, but the entire value seems to be replaced.

In the meawhile the inputs data were changed, thus I can't repeat the simulation to get again the error.

Any suggestion?

Many thanks
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Value with two decimal marks

Post by Administrator »

This is a known bug and is fixed in the current version (6.1B).

If it appears in tables, turn off "pretty number format" and it should be fine.

Tony.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
gwr
Senior Member
Posts: 209
Joined: Sun Oct 04, 2009 8:40 pm
Vensim version: DSS

Re: Value with two decimal marks

Post by gwr »

Tony,

I do not know about a fix in 6.1B because we have by now arrived at Version 6.1C in such a short time that I have never been able to even see a working Version 6.1B?

As of today I have noted that the table tool show a false value of "01" (which should have been a number close to one (e.g. 0.9...) when choosing the "pretty number" display. This has happened in Version 6.1C and I can read here that it has been fixed in Version 6.1B ?

The number will show correctly as 0.999... when "scientific numbers" is chosen in the table tool settings. BUT even that is clearly wrong because according to the Vensim reference manual the scientific number - setting
puts all numbers in the form 1.0E13, which generally shows more significant digits.
I cannot spot a number in that format (e.g. with an exponent) at all when that setting is chosen. So what is going on here?

Best regards,

Guido
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Value with two decimal marks

Post by tomfid »

I haven't had a chance to check the code, but I suspect what it's doing is essentially using the c %g format convention, which chooses between a direct decimal or scientific notation, whichever is shortest. http://www.cplusplus.com/reference/cstdio/printf/. Whether you get 0.9973 or 4.621e9 will depend on the scale of the number represented. This will give you more sigfigs for large numbers, but for other cases we should change the documentation.
apix
Senior Member
Posts: 64
Joined: Wed Mar 16, 2011 3:31 pm

Re: Value with two decimal marks

Post by apix »

(with Vensim DSS for Windows version 5.11A-1 and Windows 7)

I met a curious behavior, working with my Venapp, Excel and Bloc Notes:

I have a "1..000" value in a table workbench tool. If I look at the data in a graph tool, the trend is well drawn.
From the table, I export the data and copy once into a text editor, once into excel.
In the text editor, I have the string "1..000", as expected.
In the excel file, I get the right number!! (0.9976...) The number is right, as I could test with the updated version of the model reader, where the bug was fixed.

I wonder if you know how excel can read the right number from the "1..000" string. Maybe it's matter of codification?
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Value with two decimal marks

Post by Administrator »

This is a known bug that is now fixed. If you turn off pretty number formatting, it will display fine.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
apix
Senior Member
Posts: 64
Joined: Wed Mar 16, 2011 3:31 pm

Re: Value with two decimal marks

Post by apix »

Yes, I read your first answer.
Indeed I used the new Model Reader, with no bug.

My second question was about the Excel behavior.
But it doesn't matter. Important is that the bug does not exit anymore. Thank you!!
Post Reply